[英]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我收到以下错误
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.