当我尝试训练我的模型时,我遇到了这个错误:
(tensorflow1) C:\tensorflow1\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
Traceback (most recent call last):
File "train.py", line 52, in <module>
from object_detection.builders import model_builder
File "C:\tensorflow1\models\research\object_detection\builders\model_builder.py", line 35, in <module>
from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res
File "C:\tensorflow1\models\research\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 30, in <module>
from nets import inception_resnet_v2
File "C:\tensorflow1\models\research\slim\nets\inception_resnet_v2.py", line 375, in <module>
batch_norm_updates_collections=tf.compat.v1.GraphKeys.UPDATE_OPS,
AttributeError: module 'tensorflow.compat' has no attribute 'v1'
张量流版本:1.10.0
我正在使用 conda virtualenv 创建:
conda create -n tensorflow1 pip python=3.5
(tensorflow1) conda install tensorflow-gpu
在 Windows 10 上工作
在这里提供解决方案(答案部分),即使它出现在评论部分中也是为了社区的利益。
这段代码tf.compat.v1.GraphKeys.UPDATE_OPS
不可用于Tensorflow==1.10.0
如果您使用的是旧版本的 TensorFlow,here https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10#2a-download-tensorflow-object-detection-api-repository-from-github是一个表格,显示您应该使用的存储库的 GitHub 提交。
要让这些功能将您的版本更新为1.15
or 2.2
如下
conda install tensorflow=1.15
or
conda install tensorflow=2.2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)