747929791 / MajsoulAI

以JianYangAI作后端,进行在线雀魂对局
MIT License
265 stars 59 forks source link

AI无法正确在本地运行 #16

Closed Lica3265 closed 3 years ago

Lica3265 commented 3 years ago

問題

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

cliangyu commented 3 years ago

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')))

Lica3265 commented 3 years ago

Thanks, DavidChenL . 成功执行了!