mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Validation-accuracy on imagenet with inception-bn starts to drop after 5 epochs

Open fengjunlv opened this issue 10 years ago • 8 comments

Train-accuracy continues to increase but not for the Validation-accuracy. This is what I have observed from the log. Is this normal or did I miss something?

I am using the following settings

python example/image-classification/train_imagenet.py --network inception-bn
--data-dir /media/SSD/imagenet_mxnet/ --batch-size 128 --num-examples 1281167
--model-prefix imagenet --kv-store local_allreduce_device --lr-factor 0.9

2016-01-01 21:43:39,380 Node[0] Update[48956]: Change learning rate to 5.90490e-03 2016-01-01 21:43:49,904 Node[0] Epoch[4] Train-accuracy=0.548824 2016-01-01 21:43:49,904 Node[0] Epoch[4] Time cost=20670.702 2016-01-01 21:46:44,073 Node[0] Epoch[4] Validation-accuracy=0.406630

2016-01-02 03:30:58,979 Node[0] Update[58747]: Change learning rate to 5.31441e-03 2016-01-02 03:31:11,608 Node[0] Epoch[5] Train-accuracy=0.577686 2016-01-02 03:31:11,608 Node[0] Epoch[5] Time cost=20667.375 2016-01-02 03:34:05,323 Node[0] Epoch[5] Validation-accuracy=0.404347

2016-01-02 09:18:14,071 Node[0] Update[68538]: Change learning rate to 4.78297e-03 2016-01-02 09:18:28,803 Node[0] Epoch[6] Train-accuracy=0.600828 2016-01-02 09:18:28,803 Node[0] Epoch[6] Time cost=20663.319 2016-01-02 09:21:23,119 Node[0] Epoch[6] Validation-accuracy=0.380495

Thanks for the great tool you guys have developed

fengjunlv avatar Jan 02 '16 18:01 fengjunlv

The concept of validation accuracy dropping is related to overfitting, which deep nets are exceptionally good at, so I'd be inclined to say this is normal. many people employ early-stopping to prevent this from happening. However, I've also been told that the validation accuracy rarely goes down on imagenet.

jmschrei avatar Jan 02 '16 19:01 jmschrei

hi fengjun can you give more info about it? and are you using the lastest code of mxnet?

qiaohaijun avatar Jan 03 '16 00:01 qiaohaijun

Hi qiaohaijun,

Thanks for looking into this.

The version I am using is 0927a28d52b720d545b0b05f5658afdc458c9d56 - Mu Li, Thu Dec 31 00:36:02 2015. I am doing Imagenet training with inception-bn model, using the following settings:

python example/image-classification/train_imagenet.py --network inception-bn
--data-dir /media/SSD/imagenet_mxnet/ --batch-size 128 --num-examples 1281167
--model-prefix imagenet --kv-store local_allreduce_device --lr-factor 0.9

The training accuracy looks normal. It continues to increase to about 0.619 after 7 epochs, but the Validation-accuracy starts to drop after 5 epochs and the trend continues like this: 2016-01-01 21:46:44,073 Node[0] Epoch[4] Validation-accuracy=0.406630 2016-01-02 03:34:05,323 Node[0] Epoch[5] Validation-accuracy=0.404347 2016-01-02 09:21:23,119 Node[0] Epoch[6] Validation-accuracy=0.380495 2016-01-02 15:09:03,101 Node[0] Epoch[7] Validation-accuracy=0.361358

This is something unexpected, isn't it?

fengjunlv avatar Jan 03 '16 01:01 fengjunlv

This may be the bug in updater. Please check recent PRs: https://github.com/dmlc/mxnet/pull/1134/files and https://github.com/dmlc/mxnet/pull/1113/files

winstywang avatar Jan 03 '16 12:01 winstywang

Update in https://github.com/dmlc/mxnet/pull/1142

antinucleon avatar Jan 03 '16 12:01 antinucleon

Hi guys,

Thanks for your answers and effort. I will re-run the training with the latest code.

fengjunlv avatar Jan 03 '16 23:01 fengjunlv

I train inception-bn again, and the problem has fixed

qiaohaijun avatar Jan 04 '16 16:01 qiaohaijun

Yeah, it is confirmed everything looks normal this time. Thank you guys for the great job. Really appreciate it.

fengjunlv avatar Jan 04 '16 18:01 fengjunlv