tensorflow api訓練1(環境搭建)

1. 搭建環境

  1. 準備資源(objection detection)
    由於github下載較慢,可以點開這個鏈接下載鏈接:https://pan.baidu.com/s/1R9_-C0y7PTRXFGYet9RByQ 提取碼:ktg3
    下載完解壓,這裏只需要research文件夾,把這個文件夾複製到c盤(任何地方都可以,因爲以後都要用到,所以我放到了c盤根目錄下)
  2. 下載protoc
    建議下載protoc-3.4.0-win32,下載地址:https://github.com/google/protobuf/releases/tag/v3.4.0 下載完解壓,將bin文件夾下面的protoc.exe文件複製到C:\Windows\System32目錄下
  3. 創建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
  4. 編譯
    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
  5. 測試
    在research目錄下輸入
    python object_detection/builders/model_builder_test.py
    在這裏插入圖片描述表示成功了
  6. 如果報錯
    在這裏插入圖片描述
    打開slim文件夾,複製nets文件夾,粘貼到程序目錄中(object_detection/builders)
    再運行.py文件,成功!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章