ai-forever / Real-ESRGAN

PyTorch implementation of Real-ESRGAN model
BSD 3-Clause "New" or "Revised" License
463 stars 118 forks source link

RealESRGAN_x8.pth creating issue #5

Closed air55555 closed 2 years ago

air55555 commented 2 years ago

I tried to test RealESRGAN_x8.pth model via your colab notebook. Got an error-

RuntimeError Traceback (most recent call last) in () 9 10 model = RealESRGAN(device, scale=4) ---> 11 model.load_weights('weights/RealESRGAN_x8.pth')

1 frames /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict) 1496 if len(error_msgs) > 0: 1497 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( -> 1498 self.class.name, "\n\t".join(error_msgs))) 1499 return _IncompatibleKeys(missing_keys, unexpected_keys) 1500

RuntimeError: Error(s) in loading state_dict for RRDBNet: Unexpected key(s) in state_dict: "conv_up3.weight", "conv_up3.bias".

boomb0om commented 2 years ago

Hi, Change scale parameter to 8 when creating the model in the line above. It should be: model = RealESRGAN(device, scale=8)

air55555 commented 2 years ago

Closed, working with model = RealESRGAN(device, scale=8) params