pytorch-CycleGAN-and-pix2pix icon indicating copy to clipboard operation
pytorch-CycleGAN-and-pix2pix copied to clipboard

The training result is very good, and the test result is fuzzy

Open songyn95 opened this issue 3 years ago • 1 comments

When I used the pix2pixHD method, the training effect was very good, but when I tested, the results were very vague. I carefully compared the parameters and found that they were the same as the training parameters. Why did this problem occur? How to solve this problem? My training and testing commands are as follows:

  1. python train.py --name testIR-mix1 --label_nc 0 --no_instance --loadSize 1024 --fineSize 512 --resize_or_crop crop --gpu_ids 0,1 --dataroot /data1/syn/pix2pixHD/datasets/testIR-mix --batchSize 2 --niter 500 --continue_train
  2. python test.py --name testIR-mix1 --loadSize 1024 --fineSize 512 --resize_or_crop scale_width --dataroot /data1/syn/pix2pixHD/datasets/testIR-mix --label_nc 0 --no_instance --gpu_ids 0(Fine tune image size(fineSize )due to limited video memory)

songyn95 avatar Jun 16 '22 08:06 songyn95

There could be due to several reasons.

  1. You may use different preprocessing codes during training and test time. You want to make sure that you use the same. One test is that you feed a training set image to your model, and it should produce the roughly the same result as you have overserved during training stage. It seems that you are using --resize_or_crop crop during training but scale-width during test time.
  2. Your model may overfit to your training set if your training set is small. You may consider early stopping and using an earlier checkpoint.

junyanz avatar Jul 04 '22 17:07 junyanz