簡體   English   中英

屬性 AttributeError:模塊“tensorflow.compat.v2”沒有屬性“_internal_”

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

按照 CARLA 教程,我創建了一個文件來訓練我的模型; 但是,每當我嘗試使用命令提示符運行它時,都會出現此錯誤:

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_'

我嘗試卸載KerasTensorFlow並重新安裝它們,但錯誤仍然存​​在。

來自評論

嘗試恢復到舊版本的tf ,這可能會有所幫助(轉述自 StarShine)

其實上述問題是由於最新之間的不兼容Tensorflow版本和獨立Keras 有關更多信息,您可以參考此處

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM