isayev / ReLeaSE

Deep Reinforcement Learning for de-novo Drug Design
MIT License
344 stars 134 forks source link

Model Loading Error #17

Open hello1910 opened 5 years ago

hello1910 commented 5 years ago

Sorry for the inconvenience!

my_generator.load_model('checkpoints/generator/checkpoint_biggest') leads to the following error:

RuntimeError: Error(s) in loading state_dict for StackAugmentedRNN: Missing key(s) in state_dict: "rnn.weight_ih_l0", "rnn.weight_hh_l0", "rnn.bias_ih_l0", "rnn.bias_hh_l0", "rnn.weight_ih_l0_reverse", "rnn.weight_hh_l0_reverse", "rnn.bias_ih_l0_reverse", "rnn.bias_hh_l0_reverse". Unexpected key(s) in state_dict: "gru.weight_ih_l0", "gru.weight_hh_l0", "gru.bias_ih_l0", "gru.bias_hh_l0". size mismatch for stack_controls_layer.weight: copying a param of torch.Size([3, 1000]) from checkpoint, where the shape is torch.Size([3, 1500]) in current model. size mismatch for stack_input_layer.weight: copying a param of torch.Size([100, 1000]) from checkpoint, where the shape is torch.Size([1500, 1500]) in current model. size mismatch for stack_input_layer.bias: copying a param of torch.Size([100]) from checkpoint, where the shape is torch.Size([1500]) in current model. size mismatch for encoder.weight: copying a param of torch.Size([45, 500]) from checkpoint, where the shape is torch.Size([45, 1500]) in current model. size mismatch for decoder.weight: copying a param of torch.Size([45, 1000]) from checkpoint, where the shape is torch.Size([45, 1500]) in current model.

Do you potentially know why this is the case? Thank you!

hello1910 commented 5 years ago

Sorry, I was able to fix the issue by changing the hidden size and stack width like you mentioned.

I also had to change it from an RNN to a GRU to make it work.