zsyOAOA / DifFace

DifFace: Blind Face Restoration with Diffused Error Contraction (TPAMI, 2024)
Other
628 stars 42 forks source link

Can't load diffused estimator (SwinIR) trained model #7

Closed IBTIISAM closed 1 year ago

IBTIISAM commented 1 year ago

I trained SwinIR and saved the ckpts . i'm trying to inference the new model after i changed the ckpts paths in "iddpm_ffhq512_swinir.yaml" i have issue in loading new model state_dict

" RuntimeError: Error(s) in loading state_dict for SwinIR: Missing key(s) in state_dict: "conv_first.1.weight", "conv_first .... "

note : " inference code is worked with pretrained "model /weights/SwinIR/General_Face_ffhq512.pth" .

IBTIISAM commented 1 year ago

i've fixed it. the checkpoint ' state_dict' was inside another dictionary. in load_model function in sampler.py ckpt = ckpt['state_dict']