我已经安装了带有Anaconda的TensorFlow,但它显示了一个错误。
我有以下版本:
Python 3.9.13
keras 2.11.0
tensorflow 2.11.0
tensorflow-estimator 2.11.0
tensorflow-gpu 2.10.1
tensorboard 2.11.0
这是我得到的错误:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow-gpu 2.10.1 requires keras<2.11,>=2.10.0, but you have keras 2.11.0 which is incompatible.
tensorflow-gpu 2.10.1 requires tensorboard<2.11,>=2.10, but you have tensorboard 2.11.0 which is incompatible.
tensorflow-gpu 2.10.1 requires tensorflow-estimator<2.11,>=2.10.0, but you have tensorflow-estimator 2.11.0 which is incompatible.
此外,当我运行
from tensorflow.keras.layers import TextVectorization
这是错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_6684\2805265792.py in <module>
----> 1 from tensorflow.keras.layers import TextVectorization
ModuleNotFoundError: No module named 'tensorflow.keras'
我尝试了以下方法:
pip install --user --upgrade tensorflow
pip install keras==2.11
pip install tensorflow-estimator==2.11
pip install tensorboard==2.11
但都不管用。
1条答案
按热度按时间j0pj023g1#
关于第一个错误,我认为你只需要安装兼容的版本:
关于第二个错误,您是否尝试过:
而不是使用
tensorflow.keras
?(Of当然你必须先用
pip install keras
安装keras)