【tensorflow2.6.0 一系列相关报错记录】
tensorflow2.6.0出现的一些列报错记录
(1)tensorflow出现的numpy报错
ImportError: this version of pandas is incompatible with numpy < 1.20.3
your numpy version is 1.19.5.
Please upgrade numpy to >= 1.20.3 to use this pandas version
pip install --upgrade numpy
更新后出现报错(2)
(2)更新numpy后又出现的报错
AttributeError: module ‘numpy’ has no attribute ‘object’.
np.object
was a deprecated alias for the builtin object
. To avoid this error in existing code, use object
by itself. Doing this will not modify any behavior and is safe.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
出现这个问题重新安装numpy1.19.5,又出现下面报错(3)
尝试修改
File ~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\framework\dtypes.py:585,将np.object替换为object
AttributeError: module ‘numpy’ has no attribute ‘bool’.
np.bool
was a deprecated alias for the builtin bool
. To avoid this error in existing code, use bool
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_
here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
ImportError: cannot import name ‘dtensor’ from ‘tensorflow.compat.v2.experimental’
(3)安装修改完成后又出现的报错
ImportError: Matplotlib requires numpy>=1.20; you have 1.19.5
(4)改了半天还是出现奇怪的报错(终极解决办法)
首先删除C:\Users\songlin\AppData\Roaming\Python\Python38\site-packages\tensorflow这个文件夹,重新安装tensorflow
pip install --upgrade tensorflow
旧环境配置
conda info --envs | grep songlin_temp
pip list | grep -E "tensorflow|numpy|pandas|matplotlib"
记录之前配置过的环境