简体   繁体   English

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

[英]AttributeError: module 'tensorflow._api.v1.config' has no attribute 'run_functions_eagerly'

Trying to run ImageAI in Jupyter.尝试在 Jupyter 中运行 ImageAI。 I'm getting the following error我收到以下错误

Using TensorFlow backend.使用 TensorFlow 后端。

AttributeError Traceback (most recent call last) in ----> 1 from imageai.Detection.Custom import DetectionModelTrainer ----> 1 中的 AttributeError Traceback(最近一次调用)来自 imageai.Detection.Custom 导入 DetectionModelTrainer

~\anaconda3\envs\ImageAI\lib\site-packages\imageai\Detection\Custom_ init _.py in 19 import cv2 20 ---> 21 tf.config.run_functions_eagerly(True) 22 os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" 23 ~\anaconda3\envs\ImageAI\lib\site-packages\imageai\Detection\ Custom_init _.py in 19 import cv2 20 ---> 21 tf.config.run_functions_eagerly(True) 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 (self, name) 191 def getattr (self, name): 192 try: --> 193 attr = getattr(self._tfmw_wrapped_module, name) 194 except AttributeError: 195 if not self._tfmw_public_apis: ~\anaconda3\envs\ImageAI\lib\site-packages\tensorflow_core\python\util\module_wrapper.py in getattr (self, name) 191 def getattr (self, name): 192 try: --> 193 attr = getattr( self._tfmw_wrapped_module, name) 194 except AttributeError: 195 if not self._tfmw_public_apis:

AttributeError: module 'tensorflow._api.v1.config' has no attribute 'run_functions_eagerly AttributeError:模块'tensorflow._api.v1.config'没有属性'run_functions_eagerly

What is the issue here?这里有什么问题? Thanks in advance提前致谢

You can try like this:你可以这样尝试:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:模块“ tensorflow”没有属性“ executing_eagerly” - AttributeError: module 'tensorflow' has no attribute 'executing_eagerly' AttributeError:模块“tensorflow._api.v1.data”没有属性“AUTOTUNE” - AttributeError: module 'tensorflow._api.v1.data' has no attribute 'AUTOTUNE' AttributeError: 模块“tensorflow._api.v1.compat”没有用于 Tensorflow 对象检测 API 的属性“v2” - AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2' For Tensorflow Object Detection API Tensorflow 对象检测 AttributeError:模块“tensorflow._api.v1.compat”没有属性“v2” - Tensorflow Object Detection AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2' AttributeError:模块“ tensorflow._api.v1.compat.v1”没有属性“ pywrap_tensorflow” - AttributeError: module 'tensorflow._api.v1.compat.v1' has no attribute 'pywrap_tensorflow' AttributeError:模块“tensorflow._api.v1.compat.v1.nn”没有属性“avg_pool2d” - AttributeError: module 'tensorflow._api.v1.compat.v1.nn' has no attribute 'avg_pool2d' AttributeError: 模块“tensorflow._api.v2.io”没有属性“tf_record_iterator” - AttributeError: module 'tensorflow._api.v2.io' has no attribute 'tf_record_iterator' AttributeError:模块“tensorflow._api.v2.train”没有属性“get_or_create_global_step” - AttributeError: module 'tensorflow._api.v2.train' has no attribute 'get_or_create_global_step' AttributeError:模块“tensorflow._api.v2.sets”没有属性“set_intersection” - AttributeError: module 'tensorflow._api.v2.sets' has no attribute 'set_intersection' AttributeError: 导入 BERT 时,模块“tensorflow_core._api.v2.train”没有属性“Optimizer” - AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'Optimizer' when importing BERT
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM