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
I'm using Windows 10, torch==1.4.0 and torchvision==0.5.0
When I run >python run_classifier.py --load transformer.pt , I get KeyError:
Creating mlstm
init BinaryClassifier with 4096 features
Traceback (most recent call last):
File "run_classifier.py", line 82, in get_model
model.load_state_dict(sd)
File "D:\sentiment-discovery\model\sentiment_classifier.py", line 326, in load_state_dict
self.lm_encoder.load_state_dict(state_dict['lm_encoder'], strict=strict)
KeyError: 'lm_encoder'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run_classifier.py", line 244, in <module>
main()
File "run_classifier.py", line 224, in main
model = get_model(args)
File "run_classifier.py", line 89, in get_model
model.lm_encoder.load_state_dict(sd)
File "D:\sentiment-discovery\model\model.py", line 180, in load_state_dict
self.encoder.load_state_dict(state_dict['encoder']['encoder'], strict=strict)
KeyError: 'encoder'
The text was updated successfully, but these errors were encountered:
MiKueen
changed the title
KeyError while running transformer model
KeyError in transformer model
Jan 23, 2020
Hi,
I'm using Windows 10, torch==1.4.0 and torchvision==0.5.0
When I run >python run_classifier.py --load transformer.pt , I get KeyError:
The text was updated successfully, but these errors were encountered: