Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Fail to load pth model files #1

Open
ReedZyd opened this issue Mar 19, 2019 · 15 comments
Open

Fail to load pth model files #1

ReedZyd opened this issue Mar 19, 2019 · 15 comments

Comments

@ReedZyd
Copy link

ReedZyd commented Mar 19, 2019

I have encountered a problem:
Traceback (most recent call last):
File "demo.py", line 5, in
dex.eval()
File "/home/zyd/Reed/DL/age-estimation/code/pytorch-DEX/dex/api.py", line 23, in _eval
gender_model.load_state_dict(torch.load(gender_model_path))
File "/home/zyd/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/serialization.py", line 367, in load
return _load(f, map_location, pickle_module)
File "/home/zyd/anaconda3/envs/pytorch/lib/python3.5/site-packages/torch/serialization.py", line 528, in _load
magic_number = pickle_module.load(f)
_pickle.UnpicklingError: invalid load key, 'v'.

How can I solve it?

@siriusdemon
Copy link
Owner

image

You should first install git-lfs, because its pth files are stored in remote lfs server.

@ReedZyd
Copy link
Author

ReedZyd commented Mar 19, 2019

The problem still exists and I can't download dex/pth/age_sd.pth(539 MB).

@siriusdemon
Copy link
Owner

Maybe you can download here and replace the two git-lfs pointer file in dex/dex/pth.
gender_sd.pth
age_sd.pth

@ReedZyd
Copy link
Author

ReedZyd commented Mar 19, 2019

I solved this problem by installing git-lfs with apt-get. Also, is there code that tests performance?I want to test the DEX network by MAE.

@ReedZyd
Copy link
Author

ReedZyd commented Mar 19, 2019

Maybe you can download here and replace the two git-lfs pointer file in dex/dex/pth.
gender_sd.pth
age_sd.pth

Thank you very much!

@siriusdemon siriusdemon changed the title A problem Fail to load pth model files Mar 19, 2019
@siriusdemon
Copy link
Owner

I solved this problem by installing git-lfs with apt-get. Also, is there code that tests performance?I want to test the DEX network by MAE.

You can have a try! Refer to its home page for performance metrics.

@siriusdemon
Copy link
Owner

siriusdemon commented Mar 19, 2019

The Great Firewall ... ... It seems that it is not a good idea to store large file by git-lfs.
Download from Google Drive or Baiduwangpang:
link: https://pan.baidu.com/s/1pnU7ZwzYU4MqCvRQN6xN0Q
code: vdij

@ReedZyd
Copy link
Author

ReedZyd commented Mar 19, 2019

Yes,I solve it!

@neverUseThisName
Copy link

Maybe you can download here and replace the two git-lfs pointer file in dex/dex/pth.
gender_sd.pth
age_sd.pth

how to modify .pth file after downloading the models?

@siriusdemon
Copy link
Owner

If any git-lfs pointer exists in dex/dex/pth, remove them.
Once you have downloaded this two files, move them to dex/dex/pth.

@danilocoura
Copy link

Maybe you can download here and replace the two git-lfs pointer file in dex/dex/pth.
gender_sd.pth
age_sd.pth

Hi. Do you have the pytorch models only trained with the imdb-wiki datasets? (I think these are also trained with the chalearn database)

Thank you!

@siriusdemon
Copy link
Owner

No. But there are other DEX implementations on github, Good luck! Happy New Year!

@danilocoura
Copy link

danilocoura commented Jan 28, 2020 via email

@danilocoura
Copy link

danilocoura commented Jan 30, 2020 via email

@quocnhat
Copy link

quocnhat commented Mar 18, 2020

Maybe you can download here and replace the two git-lfs pointer file in dex/dex/pth.
gender_sd.pth
age_sd.pth

solved the problem by either git-lfs installing and replacing 2 pretrained files. thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants