mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Resume training failed

Open fengjunlv opened this issue 10 years ago • 2 comments

When I resumed training on a saved model, the training-accuracy kept falling like this

Node[0] Epoch[2] Batch [50] Speed: 61.70 samples/sec Train-accuracy=0.418281 Node[0] Epoch[2] Batch [100] Speed: 60.60 samples/sec Train-accuracy=0.416563 Node[0] Epoch[2] Batch [150] Speed: 60.55 samples/sec Train-accuracy=0.414479 Node[0] Epoch[2] Batch [200] Speed: 60.47 samples/sec Train-accuracy=0.415664 Node[0] Epoch[2] Batch [250] Speed: 60.57 samples/sec Train-accuracy=0.414094 Node[0] Epoch[2] Batch [300] Speed: 60.58 samples/sec Train-accuracy=0.413880 Node[0] Epoch[2] Batch [350] Speed: 60.67 samples/sec Train-accuracy=0.413996 Node[0] Epoch[2] Batch [400] Speed: 60.62 samples/sec Train-accuracy=0.413730 Node[0] Epoch[2] Batch [450] Speed: 60.51 samples/sec Train-accuracy=0.413854 Node[0] Epoch[2] Batch [500] Speed: 60.55 samples/sec Train-accuracy=0.414203 Node[0] Epoch[2] Batch [550] Speed: 59.53 samples/sec Train-accuracy=0.413580 Node[0] Epoch[2] Batch [600] Speed: 60.17 samples/sec Train-accuracy=0.413177 Node[0] Epoch[2] Batch [650] Speed: 59.77 samples/sec Train-accuracy=0.412752 Node[0] Epoch[2] Batch [700] Speed: 60.55 samples/sec Train-accuracy=0.412712

This is the command line how I started the training python example/image-classification/train_imagenet.py --network inception-bn --data-dir /media/imagenet_mxnet/ --batch-size 128 --model-prefix imagenet_bn --kv-store local_allreduce_device --lr-factor 0.9

And this is the command line how I resumed the training python example/image-classification/train_imagenet.py --network inception-bn --data-dir /media/imagenet_mxnet/ --batch-size 128 --model-prefix imagenet_bn --load-epoch 2 --kv-store local_allreduce_device --lr-factor 0.9

I guess this is related to learning rate settings in the second command line. What did I miss or do wrong?

Thank you for your help.

fengjunlv avatar Jan 09 '16 02:01 fengjunlv

Solved. After 2 epochs, the learning rate becomes 0.0081 and it needs to be added manually to the command line when you resume the training

fengjunlv avatar Jan 09 '16 07:01 fengjunlv

Thanks for sharing your experience! @fengjunlv

stoneyang avatar Nov 11 '17 03:11 stoneyang