holyseven / PSPNet-TF-Reproduce

Training PSPNet in Tensorflow. Reproduce the performance from the paper.
MIT License
125 stars 30 forks source link

How to do training on fine + coarse data set? #11

Closed chowkamlee81 closed 6 years ago

chowkamlee81 commented 6 years ago

As per author of Pspnet, we need to carry out

train on extra+train (20000+2975 images),
then on train set (2975),
test on val set (500) or test on test set (1525).

By running the below command 3 times, is it possible to get correct results? command below

CUDA_VISIBLE_DEVICES=0,1,2,3 python ./train.py --subsets_for_training 'train' --ema_decay 0.9 --gpu_num 4 --network 'pspnet' --structure_in_paper 0 --train_like_in_paper 0 --initializer 'he' --color_switch 0 --poly_lr 1 --data_type 32 --lrn_rate 0.01 --weight_decay_mode 1 --weight_decay_rate 0.0001 --weight_decay_rate2 0.0001 --batch_size 2 --train_max_iter 50000 --snapshot 25000 --momentum 0.9 --random_scale 1 --scale_min 0.5 --scale_max 2.0 --random_rotate 0 --database 'Cityscapes' --server $s --fine_tune_filename '../z_pretrained_weights/resnet_v1_101.ckpt' --train_image_size 864 --test_image_size 864 --optimizer 'mom' --data_type 32 --log_dir only-resnet

Kindly let me know without changing any code, whether we can get results of 80.2 mIOU. Kindly help if any other codes are there?

holyseven commented 6 years ago

The script you give is for training 50K iterations on training set (2975) only. The important augments here are subsets_for_training, fine_tune_filename and train_max_iter.

train on extra+train (20000+2975 images),

If you want to use extra data, change to --subsets_for_training 'train,train_extra', train around 150K iterations.

then on train set (2975),

Then change to --subsets_for_training 'train' and change --fine_tune_filename to the file you obtained in the previous step, then continue training for 50K.

test on val set (500)

Then run the script like this CUDA_VISIBLE_DEVICES=0 python ./predict.py --database 'Cityscapes' --structure_in_paper 0 --save_prediction 0 --color_switch 0 --test_image_size 864 --mode 'val' --weights_ckpt './log/pspmg-only-resnet-1/model.ckpt-50000' --coloring 0 --mirror 1 --ms 1. The python code train.py concludes a test without multi-scale, which gives around 80.1. The predict.py uses multi-scale test, which gives around 81.2.

Note that I used 8 (2x4) crops (864x864) in a mini-batch during training.

chowkamlee81 commented 6 years ago

Now i understood the code for running model multiple times to land up good result... Very much thank of you... Closing the issue