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:
- Downgrade the protobuf package to 3.20.x or lower.
- 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
- 将修改后的文件复制到刚才的bin目录中。
在pycharm中测试是否安装成功:
import tensorflow as tf
gpus = tf.config.list_physical_devices('gpu')
print(gpus)
print(123)
如果出现下方成功提示,说明安装完成。
[图片上传失败...(image-8536e1-1662003300704)]