【问题标题】:AttributeError: module 'tensorflow_estimator.python.estimator.api._v1.estimator' has no attribute 'slim'AttributeError:模块\'tensorflow_estimator.python.estimator.api._v1.estimator\'没有属性\'slim\'
【发布时间】:2022-11-28 07:03:27
【问题描述】:

我正在尝试运行训练命令并收到以下错误。

命令:-

python Tensorflow\models\research\object_detection\model_main_tf2.py --model_dir=Tensorflow\workspace\models\my_ssd_mobnet --pipeline_config_path=Tensorflow\workspace\models\my_ssd_mobnet\pipeline.config --num_train_steps=10000

错误:-

2022-03-24 23:29:43.298657: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-03-24 23:29:43.298983: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "C:\Users\USER\Documents\Python Scripts\ANPR_Detection\Tensorflow\models\research\object_detection\model_main_tf2.py", line 32, in <module>
    from object_detection import model_lib_v2
  File "C:\Users\USER\anaconda3\envs\anprsys\lib\site-packages\object_detection\model_lib_v2.py", line 30, in <module>
    from object_detection import inputs
  File "C:\Users\USER\anaconda3\envs\anprsys\lib\site-packages\object_detection\inputs.py", line 24, in <module>
    from object_detection.builders import dataset_builder
  File "C:\Users\USER\anaconda3\envs\anprsys\lib\site-packages\object_detection\builders\dataset_builder.py", line 27, in <module>
    from object_detection.data_decoders import tf_example_decoder
  File "C:\Users\USER\anaconda3\envs\anprsys\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 28, in <module>
    slim_example_decoder = tf.compat.v1.estimator.slim.tfexample_decoder
  File "C:\Users\USER\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\util\lazy_loader.py", line 59, in __getattr__
    return getattr(module, item)
  File "C:\Users\USER\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\util\module_wrapper.py", line 232, in _getattr
    attr = getattr(self._tfmw_wrapped_module, name)
AttributeError: module 'tensorflow_estimator.python.estimator.api._v1.estimator' has no attribute 'slim'

我已经使用pip install slimpip install tf-slim 安装了 slim。

【问题讨论】:

    标签: python tensorflow slim


    【解决方案1】:

    来自张量流/模型/研究/

    导出 PYTHONPATH=$PYTHONPATH:pwd:pwd/slim

    【讨论】:

    • 能否请您提供更多详细信息!请。我想我遇到了同样的问题,我得到了这个错误attr = getattr(self._tfmw_wrapped_module, name) AttributeError: module 'tensorflow_estimator.python.estimator.api._v1.estimator' has no attribute 'slim'。我尝试导出,但在我的 cmd 中无法识别它。另外,“来自 tensorflow/models/research/”是什么意思。
    【解决方案2】:

    你找到解决这个问题的方法了吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-14
      • 2019-02-18
      • 1970-01-01
      • 2020-01-01
      • 1970-01-01
      • 2019-07-20
      相关资源
      最近更新 更多