You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/09/28 06:52:02 UTC

[GitHub] qingzhouzhen opened a new pull request #8070: modify shell file of classification for gluon

qingzhouzhen opened a new pull request #8070: modify shell file of classification for gluon
URL: https://github.com/apache/incubator-mxnet/pull/8070
 
 
   I added and checked below function:
   1 add loading checkpoint weight
   2 make a folder if the path of model-prefix is not exist
   3 change learning rate at exact lr-step-epochs
   
   Test my implementation:
   `python image_classification.py --dataset=imagenet --train-data=/data/ILSVRC2012_img_train.rec --val-data=/data/ILSVRC2012_img_val.rec --gpus=4 --model=mobilenet0.5 --mode='symbolic' --model-prefix=mobilenet-models/mobilenet --load-epoch=5 --lr-step-epochs='3,6,9' --epochs=10`
   load pre_trained weight:
   `[12:14:15] src/io/iter_image_recordio_2.cc:153: ImageRecordIOParser2: /data/ILSVRC2012_img_train.rec, use 23 threads for decoding..
   [12:14:16] src/io/iter_image_recordio_2.cc:153: ImageRecordIOParser2: /data/ILSVRC2012_img_val.rec, use 23 threads for decoding..
   INFO:root:Loaded model mobilenet-models/mobilenet_0005.params
   INFO:root:Adjust learning rate to 1.000000e-03 for epoch 5
   `
   At epoch 6 and epoch 9 learning rate drop as expected:
   INFO:root:Epoch[5] Batch [9850] Speed: 1002.63 samples/sec      accuracy=0.414219
   INFO:root:Epoch[5] Batch [9900] Speed: 995.15 samples/sec       accuracy=0.426094
   INFO:root:Epoch[5] Batch [9950] Speed: 1009.33 samples/sec      accuracy=0.428125
   INFO:root:Epoch[5] Batch [10000]        Speed: 1037.10 samples/sec      accuracy=0.423594
   INFO:root:Update[10010]: Change learning rate to 1.00000e-04
   INFO:root:Epoch[5] Train-accuracy=0.390625
   INFO:root:Epoch[5] Time cost=1258.750
   INFO:root:Saved checkpoint to "mobilenet-models/mobilenet-0006.params"
   INFO:root:Epoch[5] Validation-accuracy=0.417539
   INFO:root:Epoch[6] Batch [50]   Speed: 1061.45 samples/sec      accuracy=0.404871
   INFO:root:Epoch[6] Batch [100]  Speed: 972.30 samples/sec       accuracy=0.406250
   
   I think there is no need to wright 
   `mod.save_params('image-classifier-%s-%d-final.params'%(opt.model, opt.epochs))`,
   but for safety, I just motify the syntax error.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services