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

Loading exception in evaluation phase #236

Open
Salvatore-tech opened this issue Jul 27, 2022 · 0 comments
Open

Loading exception in evaluation phase #236

Salvatore-tech opened this issue Jul 27, 2022 · 0 comments

Comments

@Salvatore-tech
Copy link

Hello,
I get the following exception when trying to load a finetuned model...Could you give any hints?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/salvatore/.local/lib/python3.7/site-packages/torch/serialization.py", line 595, in _load
    return legacy_load(f)
  File "/home/salvatore/.local/lib/python3.7/site-packages/torch/serialization.py", line 506, in legacy_load
    with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar, \
  File "/opt/share/sw/anaconda/anaconda3/lib/python3.7/tarfile.py", line 1591, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/opt/share/sw/anaconda/anaconda3/lib/python3.7/tarfile.py", line 1621, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/opt/share/sw/anaconda/anaconda3/lib/python3.7/tarfile.py", line 1484, in __init__
    self.firstmember = self.next()
  File "/opt/share/sw/anaconda/anaconda3/lib/python3.7/tarfile.py", line 2301, in next
    raise ReadError(str(e))
tarfile.ReadError: invalid header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "submission.py", line 55, in <module>
    state_dict = torch.load(args.loadmodel)
  File "/home/salvatore/.local/lib/python3.7/site-packages/torch/serialization.py", line 426, in load
    return _load(f, map_location, pickle_module, **pickle_load_args)
  File "/home/salvatore/.local/lib/python3.7/site-packages/torch/serialization.py", line 599, in _load
    raise RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name))
RuntimeError: ./finetuned/checkpoint_100.tar is a zip archive (did you mean to use torch.jit.load()?)
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

1 participant