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

Corrupted pretrained model #4

Closed
kashiani opened this issue Jun 13, 2022 · 1 comment
Closed

Corrupted pretrained model #4

kashiani opened this issue Jun 13, 2022 · 1 comment

Comments

@kashiani
Copy link

kashiani commented Jun 13, 2022

I downloaded the pertained model and ran the code, but it seems that the pretrained model is corrected due to the following error:

Traceback (most recent call last):
  File "/home/code/SSAH-adversarial-attack/main.py", line 156, in <module>
    fid = return_fid(benign_img, adv_img)
  File "/home/code/SSAH-adversarial-attack/utils/fid_score.py", line 256, in return_fid
    dims=2048)
  File "/home/code/SSAH-adversarial-attack/utils/fid_score.py", line 239, in calculate_fid_given_paths
    model = InceptionV3([block_idx]).to(device)
  File "/home/code/SSAH-adversarial-attack/utils/inception.py", line 82, in __init__
    inception = fid_inception_v3()
  File "/home/code/SSAH-adversarial-attack/utils/inception.py", line 208, in fid_inception_v3
    state_dict = torch.load(os.path.join("checkpoints", "pt_inception-2015-12-05-6726825d.pth"))
  File "/home/anaconda3/envs/ssah/lib/python3.6/site-packages/torch/serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/anaconda3/envs/ssah/lib/python3.6/site-packages/torch/serialization.py", line 781, in _legacy_load
    deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: unexpected EOF, expected 559999 more bytes. The file might be corrupted.
@LinQinLiang
Copy link
Owner

As given in the error message, you might want to download or create the file again, as it seems to be corrupted. Or you can download again from the link https://github.com/mseitzer/pytorch-fid/releases/download/fid_weights/pt_inception-2015-12-05-6726825d.pth

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