YudeWang/deeplabv3plus-pytorch

How can I get mIoU=79.916%?

Closed this issue · 15 comments

Hello, I have a problem.
1.Same hyperparamters with you, backbone=resnet101
2.Use 4 GPUs, batch_size=16
3.pretrained model=resnet101-5d3b4d8f.pth
4.Train dataset=VOC2012AUG(10582)
5.Test dataset=VOC2012val(1449)
6.Use syncbatchnorm
But I get best mIoU is 77.359% with 350 epochs. How can I get 79.916% as you.
Thanks.

Hi @He-Chao , 350 epoches seems too large, 46 epoches (about 30k itr) is enough.

Hi @He-Chao , 350 epoches seems too large, 46 epoches (about 30k itr) is enough.

Hi, I first just use backbone pretrained model:resnet101-5d3b4d8f.pth. When train deeplabv3p-res101 50 epoches, test the model in test datasets, just get 64.225% mIoU.

@He-Chao
Have you check deeplabv3plus_res101_atrous_VOC2012_epoch46_all.pth file achieve 79.916% on your environment?

@YudeWang
Yes, I try use your model deeplabv3plus_res101_atrous_VOC2012_epoch46_all.pth to test, but I only get 77.726% mIoU, my config as yours.

@He-Chao
Then you must have rewrite my codes, pls re-check it.

@YudeWang
OK, thank you. I'll check it.

@YudeWang
Hi, I have used your code and deeplabv3plus_res101_atrous_VOC2012_epoch46_all.pth model to test, the result is 77.726%. Where is the problem?
Thank you for your reply

@He-Chao
What about your evaluation code? (not test.py)

@YudeWang
Just use your test.py which use VOCDataset.py to get mIoU

@He-Chao
I have retest my res101 model provided in README and still achieve 79.916% on PASCAL VOC 2012 val set.

backbound: 94.733%      aeroplane: 92.422% 
    bicycle: 43.771%           bird: 89.729%
       boat: 74.913%         bottle: 82.731%
        bus: 95.616%            car: 89.028%
        cat: 94.553%          chair: 41.205%
        cow: 90.457%    diningtable: 58.292%
        dog: 90.432%          horse: 88.027%
  motorbike: 86.099%         person: 87.398%
pottedplant: 68.010%          sheep: 90.589%
       sofa: 52.553%          train: 88.096%
  tvmonitor: 79.574%
======================================================
       mIoU: 79.916% 

@YudeWang
my test result:
backbound: 93.253% aeroplane: 85.582%
bicycle: 75.956% bird: 85.601%
boat: 69.698% bottle: 77.716%
bus: 93.905% car: 84.975%
cat: 91.290% chair: 42.752%
cow: 84.114% diningtable: 56.967%
dog: 85.711% horse: 82.452%
motorbike: 79.760% person: 83.300%
pottedplant: 60.343% sheep: 85.541%
sofa: 52.075% train: 82.807%
tvmonitor: 78.446%

   mIoU: 77.726%

Test finished

parameters as yours:
self.ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname("file"),'..','..'))
self.EXP_NAME = 'deeplabv3+voc'

	self.DATA_NAME = 'VOC2012'
	self.DATA_AUG = True
	self.DATA_WORKERS = 8
	self.DATA_RESCALE = 512
	self.DATA_RANDOMCROP = 512
	self.DATA_RANDOMROTATION = 0
	self.DATA_RANDOMSCALE = 2
	self.DATA_RANDOM_H = 10
	self.DATA_RANDOM_S = 10
	self.DATA_RANDOM_V = 10
	self.DATA_RANDOMFLIP = 0.5
	
	self.MODEL_NAME = 'deeplabv3plus'
	self.MODEL_BACKBONE = 'res101_atrous'
	self.MODEL_OUTPUT_STRIDE = 16
	self.MODEL_ASPP_OUTDIM = 256
	self.MODEL_SHORTCUT_DIM = 48
	self.MODEL_SHORTCUT_KERNEL = 1
	self.MODEL_NUM_CLASSES = 21
	self.MODEL_SAVE_DIR = os.path.join(self.ROOT_DIR,'model',self.EXP_NAME)

	self.TRAIN_LR = 0.007
	self.TRAIN_LR_GAMMA = 0.1
	self.TRAIN_MOMENTUM = 0.9
	self.TRAIN_WEIGHT_DECAY = 0.00004
	self.TRAIN_BN_MOM = 0.0003
	self.TRAIN_POWER = 0.9
	self.TRAIN_GPUS = 4
	self.TRAIN_BATCHES = 16
	self.TRAIN_SHUFFLE = True
	self.TRAIN_MINEPOCH = 0	
	self.TRAIN_EPOCHS = 46
	self.TRAIN_LOSS_LAMBDA = 0
	self.TRAIN_TBLOG = True
	self.TRAIN_CKPT = None#os.path.join(self.ROOT_DIR,'model/deeplabv3+voc/deeplabv3plus_xception_VOC2012_itr0.pth')

	self.LOG_DIR = os.path.join(self.ROOT_DIR,'log',self.EXP_NAME)

	self.TEST_MULTISCALE = [0.5, 0.75, 1.0, 1.25, 1.5, 1.75]
	self.TEST_FLIP = True
	self.TEST_CKPT = os.path.join(self.ROOT_DIR,'model/deeplabv3+voc/deeplabv3plus_res101_atrous_VOC2012_epoch46_all.pth')
	self.TEST_GPUS = 4
	self.TEST_BATCHES = 16

@YudeWang
Sorry for wrong format. This is my test result by your res101 model provided in README

backbound: 93.253%      aeroplane: 85.582%
bicycle: 75.956%           bird: 85.601%
   boat: 69.698%         bottle: 77.716%
    bus: 93.905%            car: 84.975%
    cat: 91.290%          chair: 42.752%
    cow: 84.114%    diningtable: 56.967%
    dog: 85.711%          horse: 82.452%
motorbike: 79.760%         person: 83.300%
pottedplant: 60.343%          sheep: 85.541%
   sofa: 52.075%          train: 82.807%
  tvmonitor: 78.446%
======================================================
   mIoU: 77.726%

@YudeWang
Thanks for your reply. The reason is my VOC2012 dataset has some problems. Now the problems have been solved. I have got 79.944% mIoU in VOC2012val datasets by deeplabv3+resnet.

The difference between 79.944% and 79.916% may caused by pytorch (0.4 and 1.3) and cuda version (8.0 and 10.0). The code is correct and I will close the issue.

Hi~. Does 79.944% is computed from your own model (re-train by yourself) ?, or just test the model the author provides in Readme~ @He-Chao