TensorFlow 2.x Object Detection API 安装文档
注:本文档仅涉及cpu版本安装
1、Anaconda 中创建一个新的虚拟环境,随后激活
2、安装TensorFlow
在虚拟环境中执行如下命令
pip3 install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple
3、下载TensorFlow object detection API
git clone https://github.com/tensorflow/models.git
4、安装protobuf
1、在 https://github.com/google/protobuf/releases 网站中选择windows版本,解压后将bin文件夹中的protpc.exe放到C:\windows下
2、在第三步下载的文件的tensorflow/research目录下执行如下命令
protoc object_detection/protos/*.proto --python_out=.
5、安装COCO API
需要提前安装Visual C++ Build Tools
随后执行如下命令
pip3 install cython
pip3 install git+https://ghproxy.com/https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
6、安装TensorFlow Object detection API
仍是在research目录下执行
cp object_detection/packages/tf2/setup.py .
python -m pip install .
7、检查安装是否成功
执行
python object_detection/builders/model_builder_tf2_test.py
如果执行成功则说明本次安装完成