huangyangyi/TeCH

RuntimeError: Error(s) in loading state_dict for AutoencoderKL

xx674967 opened this issue · 4 comments

Hi , Thank you for open-sourcing this project. I met an issue while running conert_ldm_to_diffusers.py, as shown in the picture.
MicrosoftTeams-image (2)

It seems that the parameter names from the previous fine-tuning step do not match the VAE model. In your code, . Can this issue be addressed by modifying the names at this point? I look forward to your reply.

I have same question!

Hi, that should be a problem related to using different diffusers version. You can solve this problem by modifying code in utils/ldm_utils/convert_ldm_to_diffusers.py, changing the parameter keys from query, key, value and proj_attn to to_q, to_k, to_v and to_out.

cwwjyh commented

Hi, that should be a problem related to using different diffusers version. You can solve this problem by modifying code in utils/ldm_utils/convert_ldm_to_diffusers.py, changing the parameter keys from query, key, value and proj_attn to to_q, to_k, to_v and to_out.

I modified the code as you said above, but I encountered a question as below. Can you give me some advice? Thank you!
1704883460843
When I use to_out.0 to replace proj_attn encounter the below issue.
1704884310094

cwwjyh commented

Hi, that should be a problem related to using different diffusers version. You can solve this problem by modifying code in utils/ldm_utils/convert_ldm_to_diffusers.py, changing the parameter keys from query, key, value and proj_attn to to_q, to_k, to_v and to_out.

I modified the code as you said above, but I encountered a question as below. Can you give me some advice? Thank you! 1704883460843 When I use to_out.0 to replace proj_attn encounter the below issue. 1704884310094

I address this issue when I install diffusers==0.15.0 , and then run python utils/ldm_utils/main.py -t --data_root ${EXP_DIR}/png/ --logdir ${EXP_DIR}/ldm/ --reg_data_root data/dreambooth_data/class_${GENDER}_images/ --bg_root data/dreambooth_data/bg_images/ --class_word ${GENDER} --no-test --gpus 2,3