datitran--generate_tfrecord.py使用踩坑记录

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_38088298/article/details/87714005
  • 系统环境:
    macOS Mojave
    virtualenv
    python 2.7
  • 坑点一:No module named ‘object_detection’
    解决方式:添加环境变量
    a.使用终端打开文件
  touch .bash_profile
  open -e .bash_profile

b.在文件中添加并保存环境变量
添加

PYTHONPATH=$PYTHONPATH:/your/path/to/tensorflow/models/research:/your/path/to/tensorflow/models/research/slim

c.到配置文件中
保存

source .bash_profile

如还不能解决参考:https://github.com/datitran/raccoon_dataset/issues/14

 - https://github.com/tensorflow/models
   Download.
 - Go to folder "research".
 - Open terminal: cd Downloads/models-master/research //!!!进入到tensorflow/models/research目录下
4.(for 2.7python) python setup.py build
(for 3.6python) python3.6 setup.py build
5.(for 2.7python) sudo python setup.py install
(for 3.6python) sudo python3.6 setup.py install
 - You'll see : "Finished processing dependencies for object-detection==0.1"
  • 坑点二:tensorflow.python.framework.errors_impl.NotFoundError: image_0068.png; No such file or directory
    解决方法:
    执行时添加一个路径指定图片位置
python generate_tfrecord.py  --csv_input=flower1_train_labels.csv --output_path=flower1_train.record --image_dir=img
  • 坑点三:return tf.train.Feature(int64_list=tf.train.Int64List(value=value))
    TypeError: None has type NoneType, but expected one of: int, long
    解决方法:
    修改源码,https://github.com/datitran/raccoon_dataset/issues/14
    在这里插入图片描述
    将红圈处类名修改为你用labelImg保存的类名。

猜你喜欢

转载自blog.csdn.net/m0_38088298/article/details/87714005