错误“模块‘tensorflow.keras’没有属性‘__version__’”

问题描述 投票:0回答:1

我英语不好,所以我为你感到抱歉。 我想在 M2 mac 上使用 GPU 版本的 keras。 我按照this安装了它们。 然后我执行了它的示例代码并得到了错误。

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[5], line 2
      1 from tensorflow import keras
----> 2 keras.__version__

AttributeError: module 'tensorflow.keras' has no attribute '__version__'
python tensorflow keras gpu
1个回答
0
投票

这应该有效

print(f"Tensor Flow Version: {tf.__version__}")
print(f"Keras Version: {tensorflow.keras.__version__}")
© www.soinside.com 2019 - 2024. All rights reserved.