junxiaosong / AlphaZero_Gomoku

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

after training the model from scratch with Pytorch, running the human_play.py, RuntimeError: Error(s) in loading state_dict for Net: #93

Open redblue1987 opened 4 years ago

redblue1987 commented 4 years ago

i'm a freshman in pytorch, when i follow the guides to train the AI model from scratch, and run the human_play.py, errors display:RuntimeError: Error(s) in loading state_dict for Net: size mismatch for act_fc1.weight: copying a param with shape torch.Size([36, 144]) from checkpoint, the shape in current model is torch.Size([64, 256]). size mismatch for act_fc1.bias: copying a param with shape torch.Size([36]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for val_fc1.weight: copying a param with shape torch.Size([64, 72]) from checkpoint, the shape in current model is torch.Size([64, 128]).

But i don't modify anywhere except those mentioned in the README.md. Could you please point out where the point is? THX.

Science2AI-TaoXu commented 6 months ago

I meet the same issue

trentjmorris commented 5 months ago

I have the same issue when attempting to trace a trained Pytorch model. Any help would be MUCH appreciated! :)