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

Are pretrained weights corrupted? #5

Open
hs2022gh opened this issue Apr 28, 2022 · 1 comment
Open

Are pretrained weights corrupted? #5

hs2022gh opened this issue Apr 28, 2022 · 1 comment

Comments

@hs2022gh
Copy link

Hi, I tried to load your resnet-50 pretrained weights but displayed error messages like the below.
It seems that the weight is corrupt. Do I need any preparations after downloading the weight? If really corrupted, would you please fix them?

Thanks in advance.

Python 3.8.10 (default, Jun 26 2021, 12:40:55)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.2.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import torch

In [2]: a = torch.load('FractalDB-1000_res50.pth')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 a = torch.load('FractalDB-1000_res50.pth')

File ~/.pyenv/versions/3.8.10/lib/python3.8/site-packages/torch/serialization.py:713, in load(f, map_location, pickle_module, **pickle_load_args)
    711             return torch.jit.load(opened_file)
    712         return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
--> 713 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)

File ~/.pyenv/versions/3.8.10/lib/python3.8/site-packages/torch/serialization.py:938, in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
    936 assert key in deserialized_objects
    937 typed_storage = deserialized_objects[key]
--> 938 typed_storage._storage._set_from_file(
    939     f, offset, f_should_read_directly,
    940     torch._utils._element_size(typed_storage.dtype))
    941 if offset is not None:
    942     offset = f.tell()

RuntimeError: unexpected EOF, expected 2813703 more bytes. The file might be corrupted.

In [3]: torch.__version__
Out[3]: '1.11.0'
@hirokatsukataoka16
Copy link
Owner

Dear @hs2022gh ,

So sorry for the delayed reply. I received the same comment recently.
I noticed that the model size was different from our server. Now I replaced the model files on the drive: https://drive.google.com/drive/folders/1tTD-cKKEgBjacCi4ZJ6bRYOv6FsjtGt_?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants