【问题标题】:I saw 2 GPU indicators, Could it be the cause that I keep failing to install tensorflow-GPU?我看到 2 个 GPU 指标,难道是我一直无法安装 tensorflow-GPU 的原因?
【发布时间】:2019-09-11 17:36:42
【问题描述】:

我尝试了几十次安装 tensorflow-GPU,但都失败了,尽管我按照成功安装的人指示的说明进行操作。 我刚刚注意到我有 2 个 GPU 指标,这意味着我设置了 2 个 GUP?一台英特尔和一台英伟达。

这可能是原因吗?如果是这样,我该如何选择合适的(Nvidia)? 谢谢你的建议。

【问题讨论】:

    标签: tensorflow anaconda gpu


    【解决方案1】:

    使用以下步骤验证 tensorflow-GPU 的正确安装,

    • 你能检查一下 tensorflow 是否使用 GPU,

      import tensorflow as tf print(tf.test.is_gpu_available())

    • 要找出使用了哪个设备,您可以启用日志设备放置 像这样:

      sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

    • 你可以尝试给gpu分配一个计算,看看是否有错误

      import tensorflow as tf with tf.device('/gpu:0'): a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b') c = tf.matmul(a, b) with tf.Session() as sess: print (sess.run(c))

    • 检查 GPU 使用情况 nvidia-smi

    【讨论】:

      猜你喜欢
      • 2020-04-20
      • 1970-01-01
      • 1970-01-01
      • 2017-01-29
      • 1970-01-01
      • 2019-05-17
      • 1970-01-01
      • 2017-05-15
      • 2017-11-05
      相关资源
      最近更新 更多