asyml / texar-pytorch

Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/
https://asyml.io
Apache License 2.0
744 stars 118 forks source link

KeyError: 'Model' when run the example GPT2 #317

Closed JonOnEarth closed 2 years ago

JonOnEarth commented 3 years ago

The example of GPT2, but add the checkpoint of trained. python gpt2_generate_main.py --interactive \ --max-decoding-length=100 --temperature=0.7 --top-k=20 --nsamples=10 --checkpoint=output/model_best.ckpt

Rise the error: Traceback (most recent call last): File "gpt2_generate_main.py", line 172, in <module> main() File "gpt2_generate_main.py", line 78, in main model.load_state_dict(ckpt['model']) KeyError: 'model'