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

Issue loading pre-training model. #21

Open
PedroEstevesPT opened this issue Mar 12, 2021 · 0 comments
Open

Issue loading pre-training model. #21

PedroEstevesPT opened this issue Mar 12, 2021 · 0 comments

Comments

@PedroEstevesPT
Copy link

Hi

As mentioned in the readme I downloaded ang gunzipped the .tar.gz file, obtaining a .tar file.

mv bridge-spider-bert-large-ems-70-1-exe-68-2.tar.gz model
gunzip model/bridge-spider-bert-large-ems-70-1-exe-68-2.tar.gz
mv bridge-spider-bert-large-ems-70-1-exe-68-2.tar.gz model-best.tar

However, when performing inference, using the following line:

./experiment-bridge.sh configs/bridge/spider-bridge-bert-large.sh --inference 0 --checkpoint_path /app/TabularSemanticParsing/model/model-best.tar

I obtain this error:

Traceback (most recent call last):
File "/opt/conda/lib/python3.7/tarfile.py", line 187, in nti
n = int(s.strip() or "0", 8)
ValueError: invalid literal for int() with base 8: 'ings.tra'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/conda/lib/python3.7/tarfile.py", line 2287, in next
tarinfo = self.tarinfo.fromtarfile(self)
File "/opt/conda/lib/python3.7/tarfile.py", line 1095, in fromtarfile
obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
File "/opt/conda/lib/python3.7/tarfile.py", line 1037, in frombuf
chksum = nti(buf[148:156])
File "/opt/conda/lib/python3.7/tarfile.py", line 189, in nti
raise InvalidHeaderError("invalid header")
tarfile.InvalidHeaderError: invalid header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/.local/lib/python3.7/site-packages/torch/serialization.py", line 595, in _load
return legacy_load(f)
File "/root/.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/conda/lib/python3.7/tarfile.py", line 1591, in open
return func(name, filemode, fileobj, **kwargs)
File "/opt/conda/lib/python3.7/tarfile.py", line 1621, in taropen
return cls(name, mode, fileobj, **kwargs)
File "/opt/conda/lib/python3.7/tarfile.py", line 1484, in init
self.firstmember = self.next()
File "/opt/conda/lib/python3.7/tarfile.py", line 2299, 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 "/opt/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/opt/conda/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/app/TabularSemanticParsing/src/experiments.py", line 407, in
run_experiment(args)
File "/app/TabularSemanticParsing/src/experiments.py", line 394, in run_experiment
inference(sp)
File "/app/TabularSemanticParsing/src/experiments.py", line 104, in inference
sp.load_checkpoint(get_checkpoint_path(args))
File "/app/TabularSemanticParsing/src/common/learn_framework.py", line 423, in load_checkpoint
checkpoint = torch.load(input_file)
File "/root/.local/lib/python3.7/site-packages/torch/serialization.py", line 426, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/root/.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: /app/TabularSemanticParsing/model/model-best.tar is a zip archive (did you mean to use torch.jit.load()?)

Does anyone have a clue of what might be going on ?

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