emoca icon indicating copy to clipboard operation
emoca copied to clipboard

Wrong checkpoint paths for emotion recognition

Open Alpe6825 opened this issue 2 years ago • 9 comments

I tried to run python demos/test_emotion_recognition_on_images.py --model_type 3dmm --model_name EMOCA-emorec but always get an error that the model checkpoint does not exist - independent which model I choose.

my working directory is gdl_apps/EmotionRecognition

For example:

FileNotFoundError: [Errno 2] No such file or directory: '/is/cluster/work/rdanecek/emoca/finetune_deca/2021_11_09_19-05-01_5101174495546322475_ExpDECA_Affec_clone_NoRing_EmoB_F2_DeSegrend_BlackB_Aug_early/detail/checkpoints/last.ckpt'

Alpe6825 avatar Jul 07 '22 14:07 Alpe6825

Hello, I've faced the same problem, it seems like a bug during the loading process of DECA model. Have you sloved it?

Moon0316 avatar Nov 23 '22 02:11 Moon0316

I know, we don't need DECA in emotion recognition, you can set 'deca_checkpoint' in assets/EmotionRecognition/face_reconstruction_based/EMOCA-emorec/cfg.yaml as null

Moon0316 avatar Nov 23 '22 02:11 Moon0316

Does this mean that this part can be cleared? @Moon0316

JSHZT avatar Dec 22 '22 18:12 JSHZT

Sorry for late answering. @JSHZT I will check the hint from @Moon0316 the next days and will close the issue if its works.

Alpe6825 avatar Dec 23 '22 14:12 Alpe6825

Hello,Has the problem been solved?

shuishiwojiade avatar Jan 14 '23 02:01 shuishiwojiade

I had the problem and got a solution. open the file gdl_apps.EmotionRecognition.utils.io, in def replace_asset_dirs(cfg, output_dir : Path, ): (about line 50) find if 'deca_cfg' in cfg.keys(): (about line 52) change to if 'deca_cfg' in cfg.model.keys(): second, at def load_model(output_dir): (about line 77) print cfg. find the key of error route. The key is "cfg.model.deca_checkpoint". Assign it your checkpoint route. After modifying 2 points above, save io.py and run demo code. It could carry out.

magictower avatar Feb 03 '23 09:02 magictower

I got the same problem and solved it by set: assets/EmotionRecognition/face_reconstruction_based/EMOCA-emorec/cfg.yaml line 31:as /your_path/emoca-release-EMOCA_v2/assets/EMOCA/models/DECA/detail/checkpoints/deca-epoch=00-val_loss/dataloader_idx_0=2.2233.ckpt

tanshuai0219 avatar Dec 13 '23 08:12 tanshuai0219

Even after changing the line 31 as the correct .ckpt path still gives same error.

katariaak579 avatar Dec 19 '23 18:12 katariaak579

@magictower can you please elaborate the second point a bit more exactly what are we supposed to do in the load_model function

katariaak579 avatar Dec 19 '23 18:12 katariaak579