train_realesrnet_x4plus.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # general settings
  2. name: train_RealESRNetx4plus_1000k_B12G4
  3. model_type: RealESRNetModel
  4. scale: 4
  5. num_gpu: auto # auto: can infer from your visible devices automatically. official: 4 GPUs
  6. manual_seed: 0
  7. # ----------------- options for synthesizing training data in RealESRNetModel ----------------- #
  8. gt_usm: True # USM the ground-truth
  9. # the first degradation process
  10. resize_prob: [0.2, 0.7, 0.1] # up, down, keep
  11. resize_range: [0.15, 1.5]
  12. gaussian_noise_prob: 0.5
  13. noise_range: [1, 30]
  14. poisson_scale_range: [0.05, 3]
  15. gray_noise_prob: 0.4
  16. jpeg_range: [30, 95]
  17. # the second degradation process
  18. second_blur_prob: 0.8
  19. resize_prob2: [0.3, 0.4, 0.3] # up, down, keep
  20. resize_range2: [0.3, 1.2]
  21. gaussian_noise_prob2: 0.5
  22. noise_range2: [1, 25]
  23. poisson_scale_range2: [0.05, 2.5]
  24. gray_noise_prob2: 0.4
  25. jpeg_range2: [30, 95]
  26. gt_size: 256
  27. queue_size: 180
  28. # dataset and data loader settings
  29. datasets:
  30. train:
  31. name: DF2K+OST
  32. type: RealESRGANDataset
  33. dataroot_gt: datasets/DF2K
  34. meta_info: datasets/DF2K/meta_info/meta_info_DF2Kmultiscale+OST_sub.txt
  35. io_backend:
  36. type: disk
  37. blur_kernel_size: 21
  38. kernel_list: ['iso', 'aniso', 'generalized_iso', 'generalized_aniso', 'plateau_iso', 'plateau_aniso']
  39. kernel_prob: [0.45, 0.25, 0.12, 0.03, 0.12, 0.03]
  40. sinc_prob: 0.1
  41. blur_sigma: [0.2, 3]
  42. betag_range: [0.5, 4]
  43. betap_range: [1, 2]
  44. blur_kernel_size2: 21
  45. kernel_list2: ['iso', 'aniso', 'generalized_iso', 'generalized_aniso', 'plateau_iso', 'plateau_aniso']
  46. kernel_prob2: [0.45, 0.25, 0.12, 0.03, 0.12, 0.03]
  47. sinc_prob2: 0.1
  48. blur_sigma2: [0.2, 1.5]
  49. betag_range2: [0.5, 4]
  50. betap_range2: [1, 2]
  51. final_sinc_prob: 0.8
  52. gt_size: 256
  53. use_hflip: True
  54. use_rot: False
  55. # data loader
  56. use_shuffle: true
  57. num_worker_per_gpu: 5
  58. batch_size_per_gpu: 12
  59. dataset_enlarge_ratio: 1
  60. prefetch_mode: ~
  61. # Uncomment these for validation
  62. # val:
  63. # name: validation
  64. # type: PairedImageDataset
  65. # dataroot_gt: path_to_gt
  66. # dataroot_lq: path_to_lq
  67. # io_backend:
  68. # type: disk
  69. # network structures
  70. network_g:
  71. type: RRDBNet
  72. num_in_ch: 3
  73. num_out_ch: 3
  74. num_feat: 64
  75. num_block: 23
  76. num_grow_ch: 32
  77. # path
  78. path:
  79. pretrain_network_g: experiments/pretrained_models/ESRGAN_SRx4_DF2KOST_official-ff704c30.pth
  80. param_key_g: params_ema
  81. strict_load_g: true
  82. resume_state: ~
  83. # training settings
  84. train:
  85. ema_decay: 0.999
  86. optim_g:
  87. type: Adam
  88. lr: !!float 2e-4
  89. weight_decay: 0
  90. betas: [0.9, 0.99]
  91. scheduler:
  92. type: MultiStepLR
  93. milestones: [1000000]
  94. gamma: 0.5
  95. total_iter: 1000000
  96. warmup_iter: -1 # no warm up
  97. # losses
  98. pixel_opt:
  99. type: L1Loss
  100. loss_weight: 1.0
  101. reduction: mean
  102. # Uncomment these for validation
  103. # validation settings
  104. # val:
  105. # val_freq: !!float 5e3
  106. # save_img: True
  107. # metrics:
  108. # psnr: # metric name
  109. # type: calculate_psnr
  110. # crop_border: 4
  111. # test_y_channel: false
  112. # logging settings
  113. logger:
  114. print_freq: 100
  115. save_checkpoint_freq: !!float 5e3
  116. use_tb_logger: true
  117. wandb:
  118. project: ~
  119. resume_id: ~
  120. # dist training settings
  121. dist_params:
  122. backend: nccl
  123. port: 29500