BA Training Config Explanation

From Upscale Wiki
This is the latest revision of this page; it has no approved revision.
Jump to navigation Jump to search

name: '4x_template'

  • The name of the model. This will be used for folder names and will be appended to the model output.

use_tb_logger: true

  • Whether or not to use tenserboardx (fancy graphs)

model: 'srragan' # srragan | sr | srgan

  • The type of model. ESRGAN uses srragan

scale: 4

  • The scale of your model. 4 = 4x = 4 times the size of the original image

batch_multiplier: 1

  • how much to multiple the batch size by to create a fake larger batch. Setting this higher slows down training but should help stabilize it, especially if you have a really low batch size.

gpu_ids: [0]

  • The ID of the GPU you want to use. For most people (with 1 GPU), this is 0

use_amp: false # set to true if you have a Volta/Turing GPU or better.

  • Use Pytorch's Automatic Mixed Precision training (will speed up training, even if not on Volta/Turing)

name: 'DIV2K'

  • the name your train dataset will output in the CLI. Useless configuration.

mode: 'LRHROTF'

  • LRHR or LRHROTF. The OTF part is for On-The-Fly training. You can just leave it on LRHROTF as it doesn't change anything if you have the other settings off.

dataroot_HR: '../datasets/train/hr'

  • Single directory path to your HR dataset files

dataroot_LR: '../datasets/train/lr'

  • Single directory path to your LR dataset files

dataroot_HR: ['../datasets/train/hr1','../datasets/train/hr2','../datasets/train/hr3']

  • Multi-directory path to your HR dataset files

dataroot_LR: ['../datasets/train/lr1','../datasets/train/lr2../datasets/train/lr3']

  • Multi-directory path to your LR dataset files

subset_file: null

  • No clue what this does lol

use_shuffle: true

  • Shuffles your dataset when training so it looks at the images in a random order

n_workers: 4 # 0 to disable CPU multithreading, or an integrer representing CPU threads to use for dataloading

  • Number of CPU threads to use

batch_size: 8

  • How many images will be loaded and looked at each iteration

HR_size: 128 # patch size. Default: 128

  • The size it will crop out of your images and look at each iteration

lr_downscale: true # false

  • Set this to true to downscale your HRs into your LRs, if you don't have any LRs. Set to false if you have actual LRs

lr_downscale_types: ['area', 'matlab_bicubic'] # select from: ['nearest', 'linear', 'cubic', 'area', 'lanczos4', 'linear_exact', 'matlab_bicubic'] # scale_algos #scaling interpolation options

  • The scaling options for your generated LRs

hr_downscale: false # true | false

  • You can also downscale your HRs if you wish for them to be smaller

hr_downscale_types: ['area', 'matlab_bicubic'] # select from: ['nearest', 'linear', 'cubic', 'area', 'lanczos4', 'linear_exact', 'matlab_bicubic'] # scale_algos #scaling interpolation options hr_downscale_amount: [1, 2, 4] # Random downscale factors for HR

root: 'D:/Code/GitHub/BasicSR'

  • Set this to the root of your BasicSR directory

pretrain_model_G: '../experiments/pretrained_models/RRDB_PSNR_x4.pth'

  • The model that your model will use as a sort of base to get started with. The ones included with BasicSR originally are RRDB_ESRGAN_x4.pth or RRDB_PSNR_x4.pth, but you can use any old-arch model.

resume_state: '../experiments/debug_002_RRDB_ESRGAN_x4_DIV2K/training_state/16.state'

  • The state to resume from. You can set this to be your training_state folder and it will select the most recent one. Comment this out if starting a new model

lr_G: 1e-4 # 2e-4 # starting lr_G #Test, default: 1e-4

  • GAN learning rate

lr_D: 1e-4 # 4e-4 # starting lr_D #Test, default: 1e-4

  • Discriminator learning rate

use_frequency_separation: true

lr_scheme: 'MultiStepLR' lr_steps: [50000, 100000, 200000, 300000] # training from scratch

  • At each of these iterations, the learning rate will drop by the lr_gamma

lr_gamma: 0.5 # lr change at every step (multiplied by)

manual_seed: 0

  • Randomness seed

niter: 5e5

  • Total number of iterations to train for

val_freq: 1000 # 5e3

  • How many iterations will it take to validate the validation set

print_freq: 200

  • How many iterations will it take to print to the console again

save_checkpoint_freq: 5e3

  • How many iterations will it take to save a new model checkpoint

backup_freq: 200

  • How many iterations will it take to save a model backup