pytorch-DEX icon indicating copy to clipboard operation
pytorch-DEX copied to clipboard

Fail to load pth model files

Open ReedZyd opened this issue 5 years ago • 15 comments

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?

ReedZyd avatar Mar 19 '19 05:03 ReedZyd

image

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

siriusdemon avatar Mar 19 '19 06:03 siriusdemon

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

ReedZyd avatar Mar 19 '19 06:03 ReedZyd

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

siriusdemon avatar Mar 19 '19 07:03 siriusdemon

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 avatar Mar 19 '19 07:03 ReedZyd

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!

ReedZyd avatar Mar 19 '19 07:03 ReedZyd

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 avatar Mar 19 '19 07:03 siriusdemon

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

siriusdemon avatar Mar 19 '19 09:03 siriusdemon

Yes,I solve it!

ReedZyd avatar Mar 19 '19 09:03 ReedZyd

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?

neverUseThisName avatar Oct 20 '19 08:10 neverUseThisName

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.

siriusdemon avatar Oct 21 '19 06:10 siriusdemon

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!

danilocoura avatar Jan 23 '20 22:01 danilocoura

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

siriusdemon avatar Jan 24 '20 05:01 siriusdemon

Hi, Sirius.

Thanks for your answer. Happy New Year!

I am stuck in this problem. You released the pytorch model of "dex_chalearn_iccv2015.caffemodel". I tried to use your code (convert.py) to convert the "dex_imdb_wiki.caffemodel" ( https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/static/dex_imdb_wiki.caffemodel), but I am having problems with the protobuf size. I would like to know how you deal with this or if you could convert this model to me, please.

I really appreciate your help.

best regards

Danilo

On Fri, Jan 24, 2020 at 12:16 AM Sirius Demon [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/siriusdemon/pytorch-DEX/issues/1?email_source=notifications&email_token=AG2ILOQR4KP5RZSJB32TKB3Q7J2SBA5CNFSM4G7NGRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJZX7PY#issuecomment-577994687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2ILOU7CSB2OINWS6TDKILQ7J2SBANCNFSM4G7NGRFQ .

danilocoura avatar Jan 28 '20 22:01 danilocoura

Hi, Sirius.

I've managed my issue. I used the MMDNN to convert the models (caffe to pytorch). So, disregard the last e-mail.

Thanks for your attention.

best regards,

Danilo

On Tue, Jan 28, 2020 at 5:18 PM Danilo Coura [email protected] wrote:

Hi, Sirius.

Thanks for your answer. Happy New Year!

I am stuck in this problem. You released the pytorch model of "dex_chalearn_iccv2015.caffemodel". I tried to use your code (convert.py) to convert the "dex_imdb_wiki.caffemodel" ( https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/static/dex_imdb_wiki.caffemodel), but I am having problems with the protobuf size. I would like to know how you deal with this or if you could convert this model to me, please.

I really appreciate your help.

best regards

Danilo

On Fri, Jan 24, 2020 at 12:16 AM Sirius Demon [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/siriusdemon/pytorch-DEX/issues/1?email_source=notifications&email_token=AG2ILOQR4KP5RZSJB32TKB3Q7J2SBA5CNFSM4G7NGRF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJZX7PY#issuecomment-577994687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2ILOU7CSB2OINWS6TDKILQ7J2SBANCNFSM4G7NGRFQ .

danilocoura avatar Jan 30 '20 18:01 danilocoura

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

quocnhat avatar Mar 18 '20 12:03 quocnhat