我在CNN工作,我注意到在培训阶段,它100%使用CPU而不是GPU(我有一个GTX 1660Ti)
我试着从TensorFlow网站上关注this guide
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
输出
Num GPUs Available: 0
我试图阅读TensorFlow识别的所有设备
tf.config.list_physical_devices()
输出
[ PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU') ]
在互联网上搜索时,我发现可能我必须安装NVidia CUDA toolkit。我是从here开始做的,但没有解决它
我发现NVidia CUDA并非总是在所有GPU上启用:source。我发现有点奇怪,为什么英伟达要切断一部分客户使用CUDA
Myrequirements.txt(如果软件版本有助于解决我的问题):
matplotlib==3.4.2
keras==2.4.3
tensorflow-gpu==2.5.0
seaborn==0.11.1
我正在Jupyter笔记本中运行python代码(通过pip安装)
有一种方法可以将我的GPU用于CUDA(或者至少使用TensorFlow,如本例所示)
我终于解决了
我不得不从here下载cuDNN,根据this安装指南,我终于让它工作了
现在输出
及
现在输出
PhysicalDevice(名称='/physical_设备:GPU:0',设备_类型='GPU')]
相关问题 更多 >
编程相关推荐