有没有办法解决keras导入ternsorflow的问题


Traceback (most recent call last):
File "C:Userssurikanaconda3envsissalibsite-packageskeras__init__.py", line 3, in <module>
from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
ModuleNotFoundError: No module named 'tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 16, in <module>
from keras.models import Sequential
File "C:Userssurikanaconda3envsissalibsite-packageskeras__init__.py", line 6, in <module>
'Keras requires TensorFlow 2.2 or higher. '
ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`

我使用的tensorflow版本是2.2.2,使用的keras版本是2.4.3,python版本是3.7.0

尝试pip将TensorFlow直接安装到您的anaconda环境中。

最新更新