我正在尝试使用Tensorflow Object-Detection-API训练自己的自定义对象检测器
我在Google计算引擎中使用“ pip install tensorflow”安装了tensorflow。然后,我按照该站点上的所有说明进行操作:https : //tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html
当我尝试使用train.py时,出现以下错误消息:
追溯(最近一次通话最后一次):来自object_detection.builders的文件“ train.py”,第49行,导入dataset_builder文件“ /usr/local/lib/python3.6/dist-packages/object_detection-0.1->py3.6 .egg / object_detection / builders / dataset_builder.py“,第27行,来自object_detection.data_decoders导入tf_example_decoder文件” /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection /data_decoders/tf_example_decoder.py“,第27行,在slim_example_decoder = tf.contrib.slim.tfexample_decoder中AttributeError:模块'tensorflow'没有属性'contrib'
当我尝试学习tensorflow的版本时,我也会得到不同的结果。
python3 -c'将tensorflow导入为tf; 打印(tf。版本)':2.0.0-dev20190422
当我使用
pip3显示tensorflow:
名称:tensorflow版本:1.13.1摘要:TensorFlow是一个面向所有人的开源机器学习框架。主页:https : //www.tensorflow.org/作者:Google Inc.作者电子邮件:[email protected]许可证:Apache 2.0位置:/usr/local/lib/python3.6/dist-packages要求: gast,astor,absl-py,tensorflow估计器,keras预处理,grpcio,六,keras应用,轮,numpy,张量板,protobuf,termcolor必填:
sudo python3 train.py --logtostderr --train_dir=training/ --
pipeline_config_path=training/ssd_inception_v2_coco.config
我该怎么做才能解决这个问题?除了以下内容,我找不到与此错误消息有关的任何东西:tensorflow``模块''对象没有属性``contrib''
tf.contrib
已从TF 2.0 alpha开始移出TF。
看看这些tf 2.0发行说明https://github.com/tensorflow/tensorflow/releases/tag/v2.0.0-alpha0
您可以使用tf_upgrade_v2
脚本https:/将TF 1.x代码升级到TF2.x。/www.tensorflow.org/alpha/guide/upgrade
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句