747929791/MajsoulAI

AI无法正确在本地运行

Closed this issue · 2 comments

問題

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=torch.device('cpu') to map your storages to the CPU.

問題2

classifier.py, change line
self.model.load_state_dict(torch.load(path))
to
self.model.load_state_dict(torch.load(path, map_location=torch.device('cpu')))

Thanks, DavidChenL .
成功执行了!