【问题标题】:AttributeError: module 'tensorflow._api.v1.config' has no attribute 'run_functions_eagerly'AttributeError:模块“tensorflow._api.v1.config”没有属性“run_functions_eagerly”
【发布时间】:2021-06-09 16:56:16
【问题描述】:

尝试在 Jupyter 中运行 ImageAI。 我收到以下错误

使用 TensorFlow 后端。

AttributeError Traceback(最近一次调用最后一次) 在 ----> 1 from imageai.Detection.Custom 导入DetectionModelTrainer

~\anaconda3\envs\ImageAI\lib\site-packages\imageai\Detection\Custom_init_.py in 19 导入 cv2 20 ---> 21 tf.config.run_functions_eagerly(真) 22 os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" 23

~\anaconda3\envs\ImageAI\lib\site-packages\tensorflow_core\python\util\module_wrapper.py in getattr(自我,名称) 191 def getattr(自我,姓名): 192 尝试: --> 193 attr = getattr(self._tfmw_wrapped_module, 名称) 194 除了属性错误: 195 如果不是 self._tfmw_public_apis:

AttributeError: 模块 'tensorflow._api.v1.config' 没有属性 'run_functions_eagerly

这里有什么问题? 提前致谢

【问题讨论】:

    标签: python jupyter imageai


    【解决方案1】:

    你可以这样试试:

    import tensorflow.compat.v1 as tf
    tf.config.experimental_run_functions_eagerly(True)
    @tf.function
    def fn():
      # `enter code here
    

    【讨论】:

      猜你喜欢
      • 2021-02-06
      • 2021-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多