您的位置:首页 > 移动开发 > Objective-C

tf之object detect安装测试

2017-08-10 12:11 260 查看
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.


显示:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: