# Error for loading checkpoints sometimes

**URL:** <https://discuss.huggingface.co/t/error-for-loading-checkpoints-sometimes/724>\
**Category:** Beginners\
**Created:** [August 16, 2020, 12:54am UTC](https://discuss.huggingface.co/t/error-for-loading-checkpoints-sometimes/724 "2020-08-16T00:54:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengyahu](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mengyahu](https://discuss.huggingface.co/u/mengyahu)\
**Post date:** [August 16, 2020, 12:54am UTC](https://discuss.huggingface.co/t/error-for-loading-checkpoints-sometimes/724/1 "2020-08-16T00:54:42Z")

</div>

I fine tuned the T5 model and want to load the checkpoint. I have done this successfully for a lot of times but I got an error for one model:

> INFO:transformers.tokenization\_utils\_base:loading file [https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model](https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model) from cache at /home/t-miahu/.cache/torch/transformers/68f1b8dbca4350743bb54b8c4169fd38cbabaad564f85a9239337a8d0342af9f.9995af32582a1a7062cb3173c118cb7b4636fa03feb967340f20fc37406f021f  
> Traceback (most recent call last):  
> File “eval\_checkpoint\_WEnoLem\_PI\_fromPI.py”, line 39, in   
> model = T5FineTuner.load\_from\_checkpoint(PATH)  
> File “/home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/pytorch\_lightning/core/lightning.py”, line 1514, in load\_from\_checkpoint  
> checkpoint = torch.load(checkpoint\_path, map\_location=lambda storage, loc: storage)  
> File “/home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/serialization.py”, line 527, in load  
> with \_open\_zipfile\_reader(f) as opened\_zipfile:  
> File “/home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/serialization.py”, line 224, in **init**  
> super(\_open\_zipfile\_reader, self). **init** (torch._C.PyTorchFileReader(name\_or\_buffer))  
> RuntimeError: version_ \<= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at /pytorch/caffe2/serialize/inline\_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at /pytorch/caffe2/serialize/inline\_container.cc:132)  
> frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7f47cc697193 in /home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/lib/libc10.so)  
> frame #1: caffe2::serialize::PyTorchStreamReader::init() + 0x1f5b (0x7f472cc2b9eb in /home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/lib/libtorch.so)  
> frame #2: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std::string const&) + 0x64 (0x7f472cc2cc04 in /home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/lib/libtorch.so)  
> frame #3: + 0x6c53a6 (0x7f47cd5623a6 in /home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/lib/libtorch\_python.so)  
> frame #4: + 0x2961c4 (0x7f47cd1331c4 in /home/t-miahu/anaconda3/envs/T5env/lib/python3.6/site-packages/torch/lib/libtorch\_python.so)  
>   
> frame #39: \_\_libc\_start\_main + 0xe7 (0x7f47d1d25b97 in /lib/x86\_64-linux-gnu/libc.so.6)

It seems the version has some problem, but why I did not have this error before? Any idea why I have no problem with other checkpoints but have error for this one?

---

<div class="post-metadata">

**Author:** ![maroo93](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@maroo93](https://discuss.huggingface.co/u/maroo93)\
**Post date:** [September 6, 2020, 5:31am UTC](https://discuss.huggingface.co/t/error-for-loading-checkpoints-sometimes/724/2 "2020-09-06T05:31:33Z")

</div>

I have the same issue… Did you solve it??

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [September 6, 2020, 7:47am UTC](https://discuss.huggingface.co/t/error-for-loading-checkpoints-sometimes/724/3 "2020-09-06T07:47:07Z")

</div>

Hi @maroo93 could you post your detailed issue ?
