tensorflow遇到的问题

1. 找不到动态库cudart64_101.dll

Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found

解决方法

点击下载动态库
解压后放在C:\Windows\System32

2. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.

错误提示

TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

解决方法

先去卸载protobuf:

pip uninstall protobuf

然后重新安装3.19.0:

pip install protobuf==3.19.0

3. Could not load dynamic library ‘cusolver64_10.dll’; cusparse64_10.dll;cudnn64_7.dll

错误提示

错误信息
到了这一步基本上就完成了tensorflow-gpu的安装,先恭喜一波~~~

解决方法

先到

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v你的版本\bin

中找到cusolver64_11.dll,cusparse64_11.dll,cudnn64_8.dll这几个缺失的动态库
2.复制到桌面,修改成cusolver64_10.dll,cusparse64_10.dll,cudnn64_7.dll
3. 将修改后的文件复制到刚才的bin目录中。

在pycharm中测试是否安装成功:

import tensorflow as tf

gpus = tf.config.list_physical_devices('gpu')
print(gpus)
print(123)

如果出现下方成功提示,说明安装完成。
tensorflow遇到的问题_第1张图片

4. No module named ‘tensorflow_addons’

问题

No module named ‘tensorflow_addons’
ImportError: cannot import name ‘keras_tensor‘ from ‘tensorflow.python.keras.engine‘
两个都是同样的方法

方法

按照下图按照对应的版本
tensorflow遇到的问题_第2张图片

不定期持续更新ing

你可能感兴趣的:(tensorflow,python,人工智能)