之前一直在Caffe平台做object detection,后面查阅相关资料时,经常看到TensorFlow下的object detection API,怀着好奇心了解了下,发现效果很不错,总体而言比Caffe下要简单些。
Google niubility !
TensorFlow Object detection API 教程系列:
安装TensorFlow 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 pip install tensorflow pip install tensorflow-gpu >>> import tensorflow as tf >>> hello = tf.constant('Hello, TensorFlow!' ) >>> sess = tf.Session() >>> print (sess.run(hello))
安装TensorFlow Object Detection API 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 sudo apt-get install protobuf-compiler python-pil python-lxml sudo pip install jupyter sudo pip install matplotlib mkdir ~/tensorflow cd ~/tensorflowgit clone https://github.com/tensorflow/models.git protoc object_detection/protos/*.proto --python_out=. export PYTHONPATH=$PYTHONPATH :`pwd `:`pwd `/slimgedit ~/.bashrc export PYTHONPATH=$PYTHONPATH :/root/tensorflow/models/research:/root/tensorflow/models/research/slimpython object_detection/builders/model_builder_test.py ....... ---------------------------------------------------------------------- Ran 7 tests in 0.026s OK
Debugs 1 2 3 4 5 6 illegal instruction (sore dumped) pip uninstall tensorflow pip install tensorflow==1.5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 object_detection/protos/ssd.proto:11:3: Expected "required" , "optional" , or "repeated" . mkdir protoc_3.3 cd protoc_3.3wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip chmod 775 protoc-3.3.0-linux-x86_64.zip unzip protoc-3.3.0-linux-x86_64.zip cd /usr/local /lib/python2.7/dist-packages/tensorflow/models/~/protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.