RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1.

问题:服务器上多块卡,使用其中一张训练的模型,在本地预测的时候报错。

解决:在torch.load中加入map_location,指定一块卡

 

posted @ 2023-10-16 14:54  Liang-ml  阅读(370)  评论(0)    收藏  举报