无法运行model_main.py来获取训练数据。人为错误

系统信息

Windows 10 TensorFlow版本2.0.0 虚拟环境中的Python 3.6.9 CUDA / cuDNN:是 GPU型号和内存:GTX1080Ti,11GB

我尝试运行python main_model.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config

,但由于属性错误而无法执行。继承人显示的错误:

Traceback (most recent call last):
  File "model_main.py",line 26,in <module>
    from object_detection import model_lib
  File "C:\tensorflow1\models\research\object_detection\model_lib.py",line 27,in <module>
    from object_detection import eval_util
  File "C:\tensorflow1\models\research\object_detection\eval_util.py",line 40,in <module>
    slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'

我对https://github.com/tensorflow/tensorflow/issues/33442做了一些研究 并告诉我最好的方法,使用此链接寻找替代方法:https://github.com/tensorflow/addons

说实话,我对此还很陌生,不知道该如何替换tensorflow 2.0.0中的contrib

我目前正在关注https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

中的教程

实际结果应该能够正确训练数据

mounbo 回答:无法运行model_main.py来获取训练数据。人为错误

由于tf.contrib中的所有项目均未得到Tensorflow的正式支持,并且已指定所有者来维护它。 所有的贡献和功能都旨在合并到Tensorflow的核心中。

从Tensorflow 2.0版本开始,所有contrib项目都具有以下三个选择之一:move to coremove to a separate repository;或删除,其中大多数已由相应的项目所有者进行了审核。

link提供了tf.contrib下所有项目的详细信息和状态。

如果您使用的库已移至核心或单独的存储库,则TensorFlow的从1.x到2.x的自动代码迁移将不适用于tf.contrib projects。您需要手动更改这些部分的代码,建议继续进行。

希望这能回答您的问题,快乐学习!

本文链接:https://www.f2er.com/3169900.html

大家都在问