windows 10 64位 安装TensorFlow Object Detection API
windows 10 64位 安装TensorFlow Object Detection API
1.安装Anaconda
官网下载anaconda,教程自己搜一下,安装完成后在Anaconda Navigator的Environments下,安装python、tensorflow、keras、numpy、opencv
(Anaconda 非常好用,强烈推荐!search处直接搜索你要安装的包,注意选择all)
参考链接:https://blog.csdn.net/robintomps/article/details/77993750
2.下载TensorFlow
模型源码:https://github.com/tensorflow/models (我这里将源码文件名修改为models)
3.安装protoc
网址:https://github.com/protocolbuffers/protobuf/releases,注意windows系统只有protoc-3.6.1-win32.zip
下载至models同名文件夹下,解压,将bin文件夹中的protoc.exe复制到C:\Windows\System32下
4.测试安装成功:
windows+r 输入cmd打开命令行界面,输入命令 protoc
出现如下界面说明安装成功:
5.编译proto:
在models/research下运行Windows PowerShell
(PowerShell是cmd的超集,cmd能做的,Powershell都能做,但是Powershell还能额外做许多cmd不能做的活。此处,cmd可能会报错)
输入:
Get-ChildItem object_detection/protos/*.proto | Resolve-Path -Relative | %{ protoc $_ --python_out=. }
检查:object_detection/protos/ 文件夹下,如果每个proto文件都成了对应的以py为后缀的python源码,就说明编译成功了。
6.添加路径文件:
路径:Anaconda\Lib\site-packages 文件夹下
添加文件:tensorflow_model.pth(可以先新建一个txt文件,把内容写好后,重命名文件命为.pth格式)
内容:
F:\0\modle_0\tensorflow object detection API\models\research
F:\0\modle_0\tensorflow object detection API\models\research\slim
(第二步的安装路径)
7.运行setup.py
运行models/research下的setup.py,输入内容:
python setup.py build
python setup.py install
8.安装完成测试:
windows+r 输入cmd 输入\models\research(自己的路径)
输入:
python object_detection/builders/model_builder_test.py
出现如下信息,则成功:
9.运行已有模型
windows+r cmd 进入命令行 f:打开f盘
cd F:\0\modle_0\tensorflow object detection API\models\research(自己的路径)
输入:jupyter notebook
打开object_detection文件夹,并单击object_detection_tutorial.ipynb运行。
出现以下结果,则为成功:
参考链接:https://blog.csdn.net/qq_28019591/article/details/82023949