You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
I trained a sequence-to-sequence model using Weight Drop and then tried using it for inference. But I got the following error:
RuntimeError: Error(s) in loading state_dict for Seq2Seq:
Unexpected key(s) in state_dict: "encoder.lstm2.module.weight_hh_l0", "encoder.lstm2.module.weight_hh_l0_reverse", "encoder.lstm3.module.weight_hh_l0", "encoder.lstm3.module.weight_hh_l0_reverse", "encoder.lstm4.module.weight_hh_l0", "encoder.lstm4.module.weight_hh_l0_reverse".
I presume this is because of the fact that those keys are by default not a part of my model. I am using model.load_state_dict(torch.load('PATH'), strict=False) in order to load the weights, but I'm unsure as to whether the strict=False part is correct or not.
Please let me know if I'm erring somewhere, or in case you need any further information.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi!
I trained a sequence-to-sequence model using Weight Drop and then tried using it for inference. But I got the following error:
I presume this is because of the fact that those keys are by default not a part of my model. I am using
model.load_state_dict(torch.load('PATH'), strict=False)
in order to load the weights, but I'm unsure as to whether thestrict=False
part is correct or not.Please let me know if I'm erring somewhere, or in case you need any further information.
Thanks!
The text was updated successfully, but these errors were encountered: