tf之object detect安装测试

Tensorflow Object Detection API depends on the following libraries:
Protobuf 2.6
Pillow 1.0
lxml
tf Slim (which is included in the "tensorflow/models" checkout)
Jupyter notebook
Matplotlib
Tensorflow

安装:
[step1]
# For CPU
pip install tensorflow
# For GPU
pip install tensorflow-gpu

[step2]
sudo apt-get install protobuf-compiler python-pil python-lxml
sudo pip install jupyter
sudo pip install matplotlib
or
sudo pip install pillow
sudo pip install lxml
sudo pip install jupyter
sudo pip install matplotlib

[step3]
# From tensorflow/models/
protoc object_detection/protos/*.proto --python_out=.
出错按照下面解决办法

[step4]
# From tensorflow/models/
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

[step5]
python object_detection/builders/model_builder_test.py


问题:
When I use the commond " protoc object_detection/protos/*.proto --python_out=.",
The output:
object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optio nal", or "repeated".
object_detection/protos/anchor_generator.proto:11:32: Missing field number.

解决:
wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
下载比较慢也可以这里下载:
https://www.witsrc.com/download


chenqy@ubuntu:~/tf36/protoc_3.3$ls
protoc-3.3.0-linux-x86_64.zip 
chenqy@ubuntu:~/tf36/protoc_3.3$ unzip protoc-3.3.0-linux-x86_64.zip 
Archive:  protoc-3.3.0-linux-x86_64.zip
   creating: include/
   creating: include/google/
   creating: include/google/protobuf/
  inflating: include/google/protobuf/any.proto  
  inflating: include/google/protobuf/api.proto  
   creating: include/google/protobuf/compiler/
  inflating: include/google/protobuf/compiler/plugin.proto  
  inflating: include/google/protobuf/descriptor.proto  
  inflating: include/google/protobuf/duration.proto  
  inflating: include/google/protobuf/empty.proto  
  inflating: include/google/protobuf/field_mask.proto  
  inflating: include/google/protobuf/source_context.proto  
  inflating: include/google/protobuf/struct.proto  
  inflating: include/google/protobuf/timestamp.proto  
  inflating: include/google/protobuf/type.proto  
  inflating: include/google/protobuf/wrappers.proto  
   creating: bin/
  inflating: bin/protoc              
  inflating: readme.txt              
chenqy@ubuntu:~/tf36/protoc_3.3$ ls
bin  include  protoc-3.3.0-linux-x86_64.zip  readme.txt
chenqy@ubuntu:~/tf36/protoc_3.3$ cd bin/
chenqy@ubuntu:~/tf36/protoc_3.3/bin$ pwd
/home/chenqy/tf36/protoc_3.3/bin
chenqy@ubuntu:~/tf36/protoc_3.3/bin$ cd ../../models/
chenqy@ubuntu:~/tf36/models$ /home/chenqy/tf36/protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.
chenqy@ubuntu:~/tf36/models$ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
chenqy@ubuntu:~/tf36/models$ python object_detection/builders/model_builder_test.py
.......
----------------------------------------------------------------------
Ran 7 tests in 0.047s


OK
chenqy@ubuntu:~/tf36/models$
chenqy@ubuntu:~/tf36/models$


相关模型:
I think you are using ssd_mobilenet_v1_coco_11_06_2017 model for testing the results. Try using other models:

MODEL_NAME = 'ssd_mobilenet_v1_coco_11_06_2017'

MODEL_NAME = 'ssd_inception_v2_coco_11_06_2017'

MODEL_NAME = 'rfcn_resnet101_coco_11_06_2017' 

MODEL_NAME = 'faster_rcnn_resnet101_coco_11_06_2017'

MODEL_NAME = 'faster_rcnn_inception_resnet_v2_atrous_coco_11_06_2017'

faster_rcnn_inception_resnet_v2_atrous_coco_11_06_2017 will give you the same result as shown in tutorial.


显示:



  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值