liuzhuang13 / DenseNet

Densely Connected Convolutional Networks, In CVPR 2017 (Best Paper Award).
BSD 3-Clause "New" or "Revised" License
4.73k stars 1.07k forks source link

I tried to reproduce Wide-DenseNet-BC results on cifar10, but got 0.5% more than your error #49

Closed seasonyc closed 6 years ago

seasonyc commented 6 years ago

I tested Wide-DenseNet-BC (L=40, k=48) on CIFAR-10 augmentation, see https://github.com/seasonyc/densenet/blob/bf99d7f459ca7754c37ff58c6610eb76e93f7990/cifar10-test.py#L217 in https://github.com/seasonyc/densenet but could only get 4.5% error rate.

I tried to tune some hyper parameters, e.g. dropout, weight decay, learning rate... but always couldn't get better result. Now I am testing to follow the lr decay of wide resnet training, i.e. initial 0.1, by 0.2 per 60 epochs, but I very suspect if it will take effect...

Would you like to give me any suggestion for it?

Thanks YC

liuzhuang13 commented 6 years ago

One difference I noted is that you normalize the input by dividing 255, but we normalize the input by channel means and stds, that might be a difference.

https://github.com/liuzhuang13/DenseNet/blob/master/datasets/cifar10.lua#L37

liuzhuang13 commented 6 years ago

I noted the data augmentation in your code is significantly different, I think you can refer to this code for data augmentation in keras, https://github.com/robertomest/convnet-study/blob/master/train.py

seasonyc commented 6 years ago

Thank you very much for your check and reply! I will follow it(however, I think my input norm and aug are reasonable... :P ) and update to you once I get the result.

Have a good weekend!

seasonyc commented 6 years ago

I updated https://github.com/seasonyc/densenet/blob/master/cifar10-test.py at https://github.com/seasonyc/densenet/blob/571b0d6d3873fbec3eec9e631370e74172d05a4b/cifar10-test.py#L51 and https://github.com/seasonyc/densenet/blob/571b0d6d3873fbec3eec9e631370e74172d05a4b/cifar10-test.py#L141

The validation acc has some promotion, now the top acc is 95.64%. I think it's acceptable although it still has a bit gap than yours.

Thanks YC