【发布时间】:2020-03-30 15:24:28
【问题描述】:
重新安装 Ubuntu 18.04 后,我无法再使用 StyleGAN 代理生成图像。我得到的错误信息是InvalidArgumentError: Cannot assign a device for operation Gs_1/_Run/Gs/latents_in: {{node Gs_1/_Run/Gs/latents_in}}was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:XLA_CPU:0, /job:localhost/replica:0/task:0/device:XLA_GPU:0 ]. Make sure the device specification refers to a valid device.
我有 CUDA 10.1,我的驱动程序版本是 418.87。 conda 环境的 yml 文件可用here。我使用 pip 安装了 tensorflow-gpu==1.14。
Hereyopu 可以找到我用来生成图像的 jupyter notebook。
如果我按照建议使用命令检查可用资源
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
我得到了答案
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 7185754797200004029
, name: "/device:XLA_GPU:0"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 18095173531080603805
physical_device_desc: "device: XLA_GPU device"
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 10470458648887235209
physical_device_desc: "device: XLA_CPU device"
]
非常欢迎任何有关如何解决此问题的建议!
【问题讨论】:
标签: python tensorflow machine-learning gpu