tensorflow-gpu2.x无法检测到GPU设备
tensorflow-gpu2.x无法检测到GPU设备1.检查在解决问题前检查一下tensorflow是否只能检查到CPU,而无法检查到GPU,而非无法调用GPU。import tensorflow as tfprint(tf.test.is_gpu_available())gpus = tf.config.experimental.list_physical_devices(device_typ
·
tensorflow-gpu2.x无法检测到GPU设备
1.检查
在解决问题前检查一下tensorflow是否只能检查到CPU,而无法检查到GPU,而非无法调用GPU。
import tensorflow as tf
print(tf.test.is_gpu_available())
gpus = tf.config.experimental.list_physical_devices(device_type='GPU')
cpus = tf.config.experimental.list_physical_devices(device_type='CPU')
print(gpus, cpus)
#打印结果为
#False
#[] [PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
2.解决方法
2.1问题一:没安装对应的cudnn和cudatoolkit依赖
解决办法:安装对应的cudnn和cudatoolkit
这个我就不重述了我博文里面有:https://blog.csdn.net/qq_43203949/article/details/108479784.
注意我的安装环境是:其中Driver Version: 441.83 NVIDIA-SMI 441.83没有绝对的要求。
2.2问题二:安装了对应的依赖却缺失了关键文件(cudnn64_7.dll)
如发生一下问题:(在pycharm的红色字体报告中可以看到)
Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
解决办法:去英伟达那里下载对应的cudnn文件,并将缺失文件拷贝到对应的文件夹中即可。
这个我就不重述了,我这个也写了一个博文:
https://blog.csdn.net/qq_43203949/article/details/108550960.
更多推荐
所有评论(0)