pytorch------cpu与gpu load时相互转化 torch.load(map_location=)
将gpu改为cpu时,遇到一个报错:RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=‘cpu’ to map your storages to the CPU.此时改为:torch.
转载
2020-12-30 17:13:33 ·
1873 阅读 ·
0 评论