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

model_best.pth.tar is corrupt please upload new file #4

Open
dexception opened this issue Sep 23, 2019 · 11 comments
Open

model_best.pth.tar is corrupt please upload new file #4

dexception opened this issue Sep 23, 2019 · 11 comments

Comments

@dexception
Copy link

Hi,

Can you provide the new link ... the file at dropbox link is corrupt.

@wondonghyeon
Copy link
Owner

Could you elaborate what's wrong with the link? It works for me. Thanks!

@dexception
Copy link
Author

@wondonghyeon
Is this a regular tar file that can be extracted or we just need to use it as it is ?

@dexception
Copy link
Author

Traceback (most recent call last):
File "pred.py", line 118, in
main()
File "pred.py", line 72, in main
model.load_state_dict(torch.load(f)['state_dict'])
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 387, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 556, in _load
return legacy_load(f)
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 467, in legacy_load
with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar,
File "/usr/lib/python3.5/tarfile.py", line 1575, in open
return func(name, filemode, fileobj, **kwargs)
File "/usr/lib/python3.5/tarfile.py", line 1605, in taropen
return cls(name, mode, fileobj, **kwargs)
File "/usr/lib/python3.5/tarfile.py", line 1470, in init
self.firstmember = self.next()
File "/usr/lib/python3.5/tarfile.py", line 2279, in next
tarinfo = self.tarinfo.fromtarfile(self)
File "/usr/lib/python3.5/tarfile.py", line 1082, in fromtarfile
buf = tarfile.fileobj.read(BLOCKSIZE)
File "/usr/lib/python3.5/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

@dexception
Copy link
Author

Got it ...
This works with python2 and not python3

@davidGCR
Copy link

Could someone give the pytorch versions witch it works?

@damengdameng
Copy link

Could someone give the pytorch versions witch it works?

Hi, have you got the answer?

@davidGCR
Copy link

davidGCR commented Jun 8, 2021

@damengdameng, for me it works for pytorch 1.7.1

@damengdameng
Copy link

damengdameng commented Jun 9, 2021

In the case of python3, I just change the

with open(args.model) as f:

to

with open(args.model,'rb') as f:

then the model can be loaded successfully.

@thao-ftech
Copy link

In the case of python3, I just change the

with open(args.model) as f:

to

with open(args.model,'rb') as f:

then the model can be loaded successfully.

Confirm this helps for 0.4 torch version.

@sisrfeng
Copy link

Hi, could anyone tell us the versions of the requirements?

Pytorch NumPy pandas scikit-learn
Should we use python2 or python3 now (year 2022)?

@yangh-zzf-itcast
Copy link

In the case of python3, I just change the

with open(args.model) as f:

to

with open(args.model,'rb') as f:

then the model can be loaded successfully.

hello ,can you provide the model and datasets?thank you very much~

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

7 participants