TensorFlow Object Detection API

📅 2026/7/23 9:56:26 👁️ 阅读次数 📝 编程学习
TensorFlow Object Detection API

安装验证测试

打开anaconda _prompt输入命令行:

创建虚拟环境 conda create -n dl_21project python=3.8 -y conda activate dl_21project 安装基础 python -m pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple python -m pip install tf_slim pillow lxml matplotlib opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple 下载protoc:下载3.20.3,与python中的protobuf 包版本一致才能使用 解压到D:\protoc 安装Python protobuf 包 python -m pip install protobuf==3.20.3 -i https://pypi.tuna.tsinghua.edu.cn/simple 验证 set PATH=D:\protoc\bin;%PATH% protoc --version python -c "import google.protobuf; print(google.protobuf.__version__)" 克隆TensorFlow Models 仓库 D: cd D:\Deep-Learning-21-Examples\chapter_3 git clone https://github.com/tensorflow/models.git models_tf 编译 Protobuf 文件 cd D:\Deep-Learning-21-Examples\chapter_3\models_tf\research protoc object_detection/protos/*.proto --python_out=. 安装 Object Detection API copy object_detection\packages\tf2\setup.py . python -m pip install . 配置环境: 变量名:PYTHONPATH,变量值:D:\Deep-Learning-21Examples\chapter_3\models_tf\research;D:\Deep-Learning-21-Examples\chapter_3\models_tf\research\slim

执行训练好的模型