junxiaosong / AlphaZero_Gomoku

An implementation of the AlphaZero algorithm for Gomoku (also called Gobang or Five in a Row)
MIT License
3.28k stars 964 forks source link

用Pytorch训练保存模型,在human_play中加载模型报错 #116

Open bxdxstu opened 3 years ago

bxdxstu commented 3 years ago

Traceback (most recent call last): File "E:/project/AlphaZero_Gomoku/human_play.py", line 68, in run policy_param = pickle.load(open(model_file, 'rb')) _pickle.UnpicklingError: A load persistent id instruction was encountered, but no persistent_load function was specified.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:/project/AlphaZero_Gomoku/human_play.py", line 91, in run() File "E:/project/AlphaZero_Gomoku/human_play.py", line 72, in run encoding='bytes') # To support python3 _pickle.UnpicklingError: A load persistent id instruction was encountered, but no persistent_load function was specified.

littleWangyu commented 3 years ago

pytorch使用的这段上面的代码

wbs2788 commented 2 years ago

https://github.com/junxiaosong/AlphaZero_Gomoku/issues/97#issuecomment-653712678 给出了解决方法。