您的位置:首页 > 移动开发 > Objective-C

安装object detection API环境配置

2018-10-25 18:06 423 查看
版权声明:原创部分都是自己总结的,如果转载请指明出处。觉得有帮助的老铁,请双击666! https://blog.csdn.net/qq_36387683/article/details/83383900

1,下面记录object detection api工具的安装过程,安装环境为win10


准备工作:


(1)预先安装tensorflow-gpu-1.9.0, python3.5


(2)下载TensorFlow/model文件夹

, 新版本存在与GPU的兼容问题,所以不要更新版本
(3)在https://github.com/protocolbuffers/protobuf/releases 下载 protoc-3.4.0-win32.zip,安装protoc,设置环境变量。


(4)在research文件下执行命令:


protoc.exe object_detection/protos/*.proto --python_out=.


(5)
设置环境变量, 
将models-master;models-master/research;models-master\research\slim添加到环境变量中

如果出现Import erro : no models named '*', 则尝试将object detection也添加到环境变量中,
在models-master/research目录寻找setup.py文档。若存在,则运行python setup.py install

(6)需要安装Cython, pycocotools,pillow jupyter matplotlib lxml

Cython, 可以通过pip install Cython 直接安装
pycocotools需要进行编译, 推荐先安装GIT, 然后安装别人编译好的版本
install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

(7)运行测试命令:python object_detection/builders/model_builder_test.py
确保不报任何错误, 如果报错,则执行第四步。

(8)运行官方demo, 如果没有任何错误, 可以显示图片, 则API安装完成。
(9)如果出现  ImportError: No module named 'object_detection' 这种问题

                      在python的安装目录 :\Lib\site-packages  这个文件夹目录下,写一个.pth文件,内容为两条路径

 

-----------------------------------------------------------------------------------------------------

18.10.19更新Linux下安装object detection API 过程

其中protoc在系统中已经安装了, 所以不需要再安装,需要安装Cython, pycocotools,pillow jupyter matplotlib lxml,,、、

然后设置环境变量:export PYTHONPATH=/xx/xx/models/research/build/lib:/xx/xx/models/research/slim/build/lib:${PYTHONPATH}

运行测试命令:python object_detection/builders/model_builder_test.py
确保不报任何错误, 如果报错,则是环境变量没设置好。

安装coco API

在 https://github.com/cocodataset/cocoapi  中下载源码, 然后进入到PythonAPI目录下,执行make指令安装。

 

 

Linux 后台运行程序指令: nohup python object_detection/train.py --logtostderr --train_dir=object_detection/ssd_mobile/models/train --pipeline_config_path=object_detection/ssd_mobile/models/ssd_mobilenet_v1_pascal.config >> models_master.log  2>&1 &

暂时需要注意这些, 如果出现什么bug,试情况修改。

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: