xinntao / Real-ESRGAN

Real-ESRGAN aims at developing Practical Algorithms for General Image/Video Restoration.
BSD 3-Clause "New" or "Revised" License
26.97k stars 3.39k forks source link

ESRGAN Model training ( RRDB_ESRGAN_x4.pth) #743

Open durrani88 opened 5 months ago

durrani88 commented 5 months ago

I want to train a model with my own dataset but I am getting some error . My options file is as attached:

the error I am getting is : Traceback (most recent call last): File "C:\Users\CAE\Desktop\MY GAN\Real-ESRGAN-master\realesrgan\train.py", line 11, in train_pipeline(root_path) File "C:\Users\CAE\Desktop\MY GAN.venv\lib\site-packages\basicsr-1.4.2-py3.9.egg\basicsr\train.py", line 124, in train_pipeline model = build_model(opt) File "C:\Users\CAE\Desktop\MY GAN.venv\lib\site-packages\basicsr-1.4.2-py3.9.egg\basicsr\models__init.py", line 26, in build_model model = MODEL_REGISTRY.get(opt['model_type'])(opt) File "c:\users\cae\desktop\my gan\real-esrgan-master\realesrgan\models\realesrgan_model.py", line 24, in init super(RealESRGANModel, self).init__(opt) File "C:\Users\CAE\Desktop\MY GAN.venv\lib\site-packages\basicsr-1.4.2-py3.9.egg\basicsr\models\sr_model.py", line 30, in init self.load_network(self.net_g, load_path, self.opt['path'].get('strict_load_g', True), param_key) File "C:\Users\CAE\Desktop\MY GAN.venv\lib\site-packages\basicsr-1.4.2-py3.9.egg\basicsr\models\base_model.py", line 295, in load_network load_net = load_net[param_key] KeyError: 'params'

please help me in this regard Thanks train_test_dataset_4x.zip

KerimM-bit commented 5 months ago

path:

use the pre-trained Real-ESRNet model

pretrain_network_g: #experiments/pretrained_models/RealESRNet_x4plus.pth param_key_g: params_ema strict_load_g: false resume_state: ~

In your yml file I believe, you need uncomment above lines, if I understood error correctly

lklucky-kan commented 1 month ago

thanks