Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when "torch.load()" #581

Closed
sveits6 opened this issue Jul 31, 2020 · 6 comments
Closed

error when "torch.load()" #581

sveits6 opened this issue Jul 31, 2020 · 6 comments
Labels
question Further information is requested Stale Stale and schedule for closing soon

Comments

@sveits6
Copy link

sveits6 commented Jul 31, 2020

❔Question

Traceback (most recent call last):
File "D:\Envs\pyt1.4\lib\site-packages\torch\serialization.py", line 527, in load
with _open_zipfile_reader(f) as opened_zipfile:
File "D:\Envs\pyt1.4\lib\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 ..\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 ..\caffe2\serialize\inline_container.cc:132)
(no backtrace available)
图片
How to solve it?This just happen on the newest weights file of your google drive.The weights file of last version is ok.

Additional context

@sveits6 sveits6 added the question Further information is requested label Jul 31, 2020
@glenn-jocher
Copy link
Member

@sveits6 I don't recognize that command, and we don't assist in debugging custom code.

@mfruhner
Copy link

Hello, @glenn-jocher, I am having the same issue. It happens with the new v2.0, when starting a training in the ultralytics docker container. I pulled the latest container and started a training. It starts to download the pt file (yolov5m.pt) and then errors out:

Downloading https://drive.google.com/uc?export=download&id=1vobuEExpWQVpXExsJ2w-Mbf3HJjWkQJr as yolov5m.pt... Done (5.7s)
Traceback (most recent call last):
  File "train.py", line 469, in <module>
    train(hyp, tb_writer, opt, device)
  File "train.py", line 128, in train
    ckpt = torch.load(weights, map_location=device)  # load checkpoint
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 585, in load
    with _open_zipfile_reader(f) as opened_zipfile:
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 245, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ../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.

Were those new weights trained with pytorch 1.6? The docker container uses 1.5.x

Greetings and Thanks,
Maik

@mfruhner
Copy link

Just checked it, by installing torch==1.6.0 and torchvision==0.7.0.
It now loads correctly and starts to train. So the requirements.txt needs to be updated and the docker container rebuilt accordingly. Cheers.

@glenn-jocher
Copy link
Member

@mfruhner thanks! Yes we are in the process of updating requirements.txt to 1.6, and will be pushing native mixed precision training PR as well.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Aug 31, 2020
@github-actions github-actions bot closed this as completed Sep 5, 2020
@bbyuksel
Copy link

Just checked it, by installing torch==1.6.0 and torchvision==0.7.0. It now loads correctly and starts to train. So the requirements.txt needs to be updated and the docker container rebuilt accordingly. Cheers.

This solved my same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

4 participants