Morizeyao / GPT2-Chinese

Chinese version of GPT2 training code, using BERT tokenizer.
MIT License
7.46k stars 1.7k forks source link

transformers加载模型错误 `is a zip archive (did you mean to use torch.jit.load()?)` #206

Closed nlp4whp closed 3 years ago

nlp4whp commented 3 years ago

您还记得训练uer/gpt2-chinese-cluecorpussmall时用的torch版本么,我用transformers 4.2.1 和 2.1.1,pytorch用1.3.1,1.6.0和1.8.0都有这个错

raise RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name))

JHR0717 commented 3 years ago

先把zip文件解压用里面的pytorch_model.bin文件