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

  1. 将修改后的文件复制到刚才的bin目录中。

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

import tensorflow as tf

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

如果出现下方成功提示,说明安装完成。
[图片上传失败...(image-8536e1-1662003300704)]

不定期持续更新ing

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容