[英]Can I get tensorflow-gpu to work with NVIDIA GeForce MX130?
我知道这在任何意义上都不是机器学习的推荐设置,但我想使用我所拥有的。
不是专家,有人告诉我 tf-gpu 应该与 cuda 支持的任何设备一起使用。
当我运行时:
from numba import cuda
cuda.detect()
我得到:
Found 1 CUDA devices
id 0 b'GeForce MX130' [SUPPORTED]
compute capability: 5.0
pci device id: 0
pci bus id: 1
Summary:
1/1 devices are supported
我可以让 GPU 处理一些基本的“矢量化”任务。
另外,运行:
import tensorflow as tf
tf.test.is_built_with_cuda()
将返回 True
然而,运行
tf.config.experimental.list_physical_devices('gpu')
将返回一个空列表。
跑步:
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
将返回:
Num GPUs Available: 0
跑步:
strategy = tf.distribute.MirroredStrategy()
print("Number of devices: {}".format(strategy.num_replicas_in_sync))
将返回:
WARNING:tensorflow:There are non-GPU devices in `tf.distribute.Strategy`, not using nccl allreduce.
INFO:tensorflow:Using MirroredStrategy with devices ('/job:localhost/replica:0/task:0/device:CPU:0',)
Number of devices: 1
我已经用 tensorflow 的非 gpu 版本训练了一些基本模型,但我不知道如何处理 tf-gpu。 根据任务管理器的说法,我能够安装带有 CuDNNLSTM 层的 model,但脚本没有使用 GPU。
对于如何让它使用我的“gpu”或确认它是不可能的,我将不胜感激。 谢谢!
编辑:
我卸载了 keras 和 tensorflow 版本,只安装了 tensorflow-gpu。 没有改变。
抱歉不行。
尽管官方规格表明“是”,但 CUDA GPU 列表并未提及 MX130 作为其列表的一部分。
(我也在笔记本上运行 MX130)
参考:
绝对没错!
我假设计算能力:5.0 就足够了。
我在 Python 3.7 中使用 conda 安装的 tensorflow-gpu 测试了我的 Geforce MX130(它处理 cuda、版本兼容性等)
conda install tensorflow-gpu
而已。 无需更多操作:已安装以下版本:
tensorflow-gpu: 2.1.0
cudatoolkit: 10.1.243
cudnn: 7.6.5
......它奏效了!
安装 Cuda 和 CuDNN。 为他们设置路径。 要检查 TensorFlow 是否使用 GPU,请使用以下命令:
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
它应该在其 output 中显示您的 GPU 名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.