1. 搭建環境
- 準備資源(objection detection)
由於github下載較慢,可以點開這個鏈接下載鏈接:https://pan.baidu.com/s/1R9_-C0y7PTRXFGYet9RByQ 提取碼:ktg3
下載完解壓,這裏只需要research文件夾,把這個文件夾複製到c盤(任何地方都可以,因爲以後都要用到,所以我放到了c盤根目錄下) - 下載protoc
建議下載protoc-3.4.0-win32,下載地址:https://github.com/google/protobuf/releases/tag/v3.4.0 下載完解壓,將bin文件夾下面的protoc.exe文件複製到C:\Windows\System32目錄下 - 創建conda虛擬環境py36(需要換源)
安裝庫
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.13.1
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
conda install pillow
conda install lxml
conda install Cython
conda install matplotlib
conda install pandas
conda install jupyter
conda無法安裝pycocotools
方法:下載鏈接:https://pan.baidu.com/s/1FpuEhrKagN8SAR1-7bnd1Q
提取碼:n8ys 然後解壓,進入PythonAPI文件夾,cmd命令框內輸入
python setup.py build_ext –inplace
python setup.py build_ext install - 編譯
1.在research目錄下,去protoc
protoc object_detection/protos/*.proto --python_out=.
2.添加環境變量
3.在research目錄下 python setup.py install(一定執行這一步)
4.在research\slim目錄下
cd /d c:\research\slim
python setup.py build
Python setup.py install - 測試
在research目錄下輸入
python object_detection/builders/model_builder_test.py
表示成功了 - 如果報錯
打開slim文件夾,複製nets文件夾,粘貼到程序目錄中(object_detection/builders)
再運行.py文件,成功!