Using custom weights with .pth file (8x_NMKD-Faces_160000_G) #369

Open
opened 2026-01-29 21:47:16 +00:00 by claunia · 0 comments
Owner

Originally created by @philz1337x on GitHub (Jul 10, 2023).

I am trying to use 8x_NMKD-Faces_160000_G with GFPGAN.

I placed the pth file in the weights folder and changed the code to load the weight. But there seems to be something wrong with the arch='original' part.

elif version == '8x_NMKD-Faces_160000_G': self.face_enhancer = GFPGANer( model_path='gfpgan/weights/8x_NMKD-Faces_160000_G.pth', upscale=2, arch='original', channel_multiplier=2, bg_upsampler=self.upsampler)

I get an error:

File "cog_predict.py", line 135, in predict
self.face_enhancer = GFPGANer(
File "/src/gfpgan/utils.py", line 97, in init
self.gfpgan.load_state_dict(loadnet[keyname], strict=True)
KeyError: ‘params'

Originally created by @philz1337x on GitHub (Jul 10, 2023). I am trying to use [8x_NMKD-Faces_160000_G](https://huggingface.co/gemasai/8x_NMKD-Faces_160000_G) with GFPGAN. I placed the pth file in the weights folder and changed the code to load the weight. But there seems to be something wrong with the arch='original' part. ` elif version == '8x_NMKD-Faces_160000_G': self.face_enhancer = GFPGANer( model_path='gfpgan/weights/8x_NMKD-Faces_160000_G.pth', upscale=2, arch='original', channel_multiplier=2, bg_upsampler=self.upsampler)` I get an error: > File "cog_predict.py", line 135, in predict > self.face_enhancer = GFPGANer( > File "/src/gfpgan/utils.py", line 97, in __init__ > self.gfpgan.load_state_dict(loadnet[keyname], strict=True) > KeyError: ‘params'
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#369