protest-detection-violence-estimation icon indicating copy to clipboard operation
protest-detection-violence-estimation copied to clipboard

model_best.pth.tar is corrupt please upload new file

Open dexception opened this issue 4 years ago • 11 comments

Hi,

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

dexception avatar Sep 23 '19 14:09 dexception

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

wondonghyeon avatar Sep 24 '19 06:09 wondonghyeon

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

dexception avatar Sep 24 '19 12:09 dexception

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 avatar Sep 24 '19 12:09 dexception

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

dexception avatar Sep 24 '19 12:09 dexception

Could someone give the pytorch versions witch it works?

davidGCR avatar Feb 11 '21 12:02 davidGCR

Could someone give the pytorch versions witch it works?

Hi, have you got the answer?

damengdameng avatar Jun 08 '21 11:06 damengdameng

@damengdameng, for me it works for pytorch 1.7.1

davidGCR avatar Jun 08 '21 19:06 davidGCR

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.

damengdameng avatar Jun 09 '21 07:06 damengdameng

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.

thao-ftech avatar Jun 21 '21 10:06 thao-ftech

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

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

sisrfeng avatar Oct 20 '22 01:10 sisrfeng

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~

yangh-zzf-itcast avatar Dec 19 '23 08:12 yangh-zzf-itcast