Pretrain SSD-MobileNetv1 model
mbrookhart opened this issue · 3 comments
We should be able to reuse https://github.com/apache/incubator-mxnet/tree/master/example/ssd with the mobilenetv1 symbol.
Acceptance Criteria:
- Train model to the default number of epochs and within 10% expected accuracy (on GPU)
- Upload saved model symbol json and parameters to deepmark
- Provide a script for testing model accuracy on test data.
Made the following changes to run SSD example with MobileNetV2 symbol (MXNet repo revision c792c9f
). Am currently training the model on Pascal VOC.
- Moved
example/image-classification/symbols/mobilenetv2.py
toexample/ssd/symbol
- Added the following code to
example/ssd/symbol/symbol_factory.py
get_config
functionif
statement:
elif network == 'mobilenetv2':
num_layers = 1 + 17*3 + 2 # conv layers
network = 'mobilenetv2'
from_layers = ['seq-5-block1-exp-relu6', 'last-1x1-conv-relu6', '', '', '', '']
num_filters = [-1, -1, 512, 256, 256, 128]
strides = [-1, -1, 2, 2, 2, 2]
pads = [-1, -1, 1, 1, 1, 1]
sizes = [[.1, .141], [.2,.272], [.37, .447], [.54, .619], [.71, .79], [.88, .961]]
ratios = [[1,2,.5], [1,2,.5,3,1./3], [1,2,.5,3,1./3], [1,2,.5,3,1./3], \
[1,2,.5], [1,2,.5]]
normalizations = -1
steps = []
return locals()
- In
ssd/train/train_net.py
line 222 hack: changedelif pretained
toelif False
- In
ssd/config/config.py
line 19: changedfrom config.utils import
tofrom utils import
- add
**kwargs
toget_symbol
function inmobilenetv2.py
Then from ssd
folder run
python train.py --train-path <path to created train.rec> --val-path <path to created val.rec> --network mobilenetv2 --prefix <path to model save dir>/ssd
Where train.rec
and val.rec
were created for Pascal VOC following the README
I just realized this ticket requests MobileNet v1, not v2. Will change accordingly.
Model files, data, test script and README have been saved to /nfs/fm/disks/aipg_trained_models_01/mxnet/ssd-mobilenet-v1