- Flags: see
options/train_options.pyandoptions/base_options.pyfor the training flags; seeoptions/test_options.pyandoptions/base_options.pyfor the test flags. There are some model-specific flags as well, which are added in the model files, such as--lambda_Aoption inmodel/cycle_gan_model.py. The default values of these options are also adjusted in the model files. - CPU/GPU (default
--gpu_ids 0): set--gpu_ids -1to use CPU mode; set--gpu_ids 0,1,2for multi-GPU mode. You need a large batch size (e.g.--batch_size 32) to benefit from multiple GPUs. - Visualization: during training, the current results can be viewed using two methods. First, if you set
--display_id> 0, the results and loss plot will appear on a local graphics web server launched by visdom. To do this, you should havevisdominstalled and a server running by the commandpython -m visdom.server. The default server URL ishttp://localhost:8097.display_idcorresponds to the window ID that is displayed on thevisdomserver. Thevisdomdisplay functionality is turned on by default. To avoid the extra overhead of communicating withvisdomset--display_id -1. Second, the intermediate results are saved to[opt.checkpoints_dir]/[opt.name]/web/as an HTML file. To avoid this, set--no_html. - Preprocessing: images can be resized and cropped in different ways using
--resize_or_cropoption. The default option'resize_and_crop'resizes the image to be of size(opt.loadSize, opt.loadSize)and does a random crop of size(opt.fineSize, opt.fineSize).'crop'skips the resizing step and only performs random cropping.'scale_width'resizes the image to have widthopt.fineSizewhile keeping the aspect ratio.'scale_width_and_crop'first resizes the image to have widthopt.loadSizeand then does random cropping of size(opt.fineSize, opt.fineSize).'none'tries to skip all these preprocessing steps. However, if the image size is not a multiple of some number depending on the number of downsamplings of the generator, you will get an error because the size of the output image may be different from the size of the input image. Therefore,'none'option still tries to adjust the image size to be a multiple of 4. You might need a bigger adjustment if you change the generator architecture. Please seedata/base_datset.pydo see how all these were implemented. - Fine-tuning/Resume training: to fine-tune a pre-trained model, or resume the previous training, use the
--continue_trainflag. The program will then load the model based onwhich_epoch. By default, the program will initialize the epoch count as 1. Set--epoch_count <int>to specify a different starting epoch count.