-1

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

使用 TensorFlow 后端。

----> 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\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:模块'tensorflow._api.v1.config'没有属性'run_functions_eagerly

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

4

1 回答 1

1

你可以这样尝试:

import tensorflow.compat.v1 as tf
tf.config.experimental_run_functions_eagerly(True)
@tf.function
def fn():
  # `enter code here
于 2021-04-21T06:19:16.900 回答