【问题标题】:seems like GPU is not working in AWS Sagemaker Studio Lab似乎 GPU 在 AWS Sagemaker Studio Lab 中不起作用
【发布时间】:2021-12-21 01:53:04
【问题描述】:

我选择了 GPU 作为计算类型,并打开了我的项目。

但是检查本地设备,看起来并没有部署任何 GPU。

import tensorflow as tf
from tensorflow.python.client import device_lib
device_lib.list_local_devices()

输出:

[name: "/device:CPU:0"
 device_type: "CPU"
 memory_limit: 268435456
 locality {
 }
 incarnation: 13079107644747151451]

如何在 AWS Sagemaker 中启用 GPU 使用?

【问题讨论】:

    标签: python amazon-web-services tensorflow gpu amazon-sagemaker


    【解决方案1】:

    我在上面运行了你的代码,这是我得到的:

    [name: "/device:CPU:0"
     device_type: "CPU"
     memory_limit: 268435456
     locality {
     }
     incarnation: 1740204898309190353
     xla_global_id: -1,
     name: "/device:GPU:0"
     device_type: "GPU"
     memory_limit: 14463795200
     locality {
       bus_id: 1
       links {
       }
     }
     incarnation: 13861210837196428676
     physical_device_desc: "device: 0, name: Tesla T4, pci bus id: 0000:00:1e.0, compute capability: 7.5"
     xla_global_id: 416903419]
    

    GPU 确实部署了,我只是用它训练了我的模型。它工作正常。您真的选择 GPU 作为您的计算类型吗?如果是,您使用的是哪个 TensorFlow 版本?

    【讨论】:

    • 感谢您的回答。经过几次尝试,我发现这是因为我只安装了 tensorflow-CPU。安装 tensorflow-GPU 后,它与您的工作相同。还是谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多