Discuss / 编程 / test.py在GPU跑报错

test.py在GPU跑报错

Topic source

PBG

#1 Created at ... [Delete] [Delete and Lock User]

需要将输入数据image_tensor放到GPU上,即image_tensor = trans(image).unsqueeze(0)改为image_tensor = trans(image).unsqueeze(0).to(device)

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

👍


  • 1

Reply