简体   繁体   English

属性 AttributeError:模块“tensorflow.compat.v2”没有属性“_internal_”

[英]Attribute AttributeError: module 'tensorflow.compat.v2' has no attribute '_internal_'

Following the CARLA tutorials, I created a file to train my model;按照 CARLA 教程,我创建了一个文件来训练我的模型; however, whenever I try to run it using Command prompt, this error shows up:但是,每当我尝试使用命令提示符运行它时,都会出现此错误:

2021-06-20 19:39:30.429984: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2021-06-20 19:39:30.430242: 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.
Using TensorFlow backend.
Traceback (most recent call last):
  File "CARtut5.py", line 10, in <module>
    from keras.applications.xception import Xception
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\_init_.py", line 12, in <module>
    from . import initializers
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\initializers\_init_.py", line 124, in <module>
    populate_deserializable_objects()
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\initializers\_init_.py", line 49, in populate_deserializable_objects
    LOCAL.GENERATED_WITH_V2 = tf._internal_.tf2.enabled()
AttributeError: module 'tensorflow.compat.v2' has no attribute '_internal_'

I tried to uninstall Keras and TensorFlow and reinstall them, but the error persists.我尝试卸载KerasTensorFlow并重新安装它们,但错误仍然存​​在。

From comments来自评论

Try to revert to an older version of tf , that might help (paraphrased from StarShine)尝试恢复到旧版本的tf ,这可能会有所帮助(转述自 StarShine)

Actually the above issue was due to incompatibility between latest Tensorflow version and standalone Keras .其实上述问题是由于最新之间的不兼容Tensorflow版本和独立Keras For more information you can refer here .有关更多信息,您可以参考此处

暂无
暂无

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

相关问题 AttributeError:模块 'tensorflow.compat.v2' 没有属性 'logging' - AttributeError: module 'tensorflow.compat.v2' has no attribute 'logging' AttributeError:模块“tensorflow.compat.v2”没有属性“depth_to_space” - AttributeError: module 'tensorflow.compat.v2' has no attribute 'depth_to_space' AttributeError: 模块 'tensorflow.compat.v2.__internal__' 没有属性 'dispatch' - AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'dispatch' AttributeError:模块'tensorflow_core.compat.v2'没有属性'__internal__'(一周前工作?) - AttributeError: module 'tensorflow_core.compat.v2' has no attribute '__internal__' (Worked a week ago?) AttributeError: 模块“tensorflow_core.compat.v1”没有属性“contrib” - AttributeError: module 'tensorflow_core.compat.v1' has no attribute 'contrib' 模块“tensorflow.compat.v2.__internal__”没有属性“tf2” - module 'tensorflow.compat.v2.__internal__' has no attribute 'tf2' AttributeError:加载 tf.compat.v1.train.SessionRunHook 时模块“tensorflow”没有属性“compat” - AttributeError: module 'tensorflow' has no attribute 'compat' when loading tf.compat.v1.train.SessionRunHook AttributeError: 模块“tensorflow._api.v1.compat”没有用于 Tensorflow 对象检测 API 的属性“v2” - AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2' For Tensorflow Object Detection API AttributeError: 模块 &#39;tensorflow.compat&#39; 没有属性 &#39;v1&#39; Tensorflow v: 1.10.0 - AttributeError: module 'tensorflow.compat' has no attribute 'v1' Tensorflow v: 1.10.0 导入时出错 keras: AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'register_clear_session_function' - Error while import keras: AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'register_clear_session_function'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM