mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Issues in conversion of caffe model to mxnet

Open gaush123 opened this issue 10 years ago • 2 comments

I have been trying to convert squeezenet architecture (https://github.com/songhan/SqueezeNet-Deep-Compression) to mxnet. While I was able to convert the model successfully; model gives 9000 classes in output as against 1000 in the original model. Also tried converting another model based on the same architecture with 2 classes and got 18 classes (again 9 (3X3) times the expected) in mxnet converted model.

converting layer conv1, wmat shape = (96, 3, 7, 7), bias shape = (96,) converting layer fire2_squeeze1x1, wmat shape = (16, 96, 1, 1), bias shape = (16,) converting layer fire2_expand1x1, wmat shape = (64, 16, 1, 1), bias shape = (64,) converting layer fire2_expand3x3, wmat shape = (64, 16, 3, 3), bias shape = (64,) converting layer fire3_squeeze1x1, wmat shape = (16, 128, 1, 1), bias shape = (16,) converting layer fire3_expand1x1, wmat shape = (64, 16, 1, 1), bias shape = (64,) converting layer fire3_expand3x3, wmat shape = (64, 16, 3, 3), bias shape = (64,) converting layer fire4_squeeze1x1, wmat shape = (32, 128, 1, 1), bias shape = (32,) converting layer fire4_expand1x1, wmat shape = (128, 32, 1, 1), bias shape = (128,) converting layer fire4_expand3x3, wmat shape = (128, 32, 3, 3), bias shape = (128,) converting layer fire5_squeeze1x1, wmat shape = (32, 256, 1, 1), bias shape = (32,) converting layer fire5_expand1x1, wmat shape = (128, 32, 1, 1), bias shape = (128,) converting layer fire5_expand3x3, wmat shape = (128, 32, 3, 3), bias shape = (128,) converting layer fire6_squeeze1x1, wmat shape = (48, 256, 1, 1), bias shape = (48,) converting layer fire6_expand1x1, wmat shape = (192, 48, 1, 1), bias shape = (192,) converting layer fire6_expand3x3, wmat shape = (192, 48, 3, 3), bias shape = (192,) converting layer fire7_squeeze1x1, wmat shape = (48, 384, 1, 1), bias shape = (48,) converting layer fire7_expand1x1, wmat shape = (192, 48, 1, 1), bias shape = (192,) converting layer fire7_expand3x3, wmat shape = (192, 48, 3, 3), bias shape = (192,) converting layer fire8_squeeze1x1, wmat shape = (64, 384, 1, 1), bias shape = (64,) converting layer fire8_expand1x1, wmat shape = (256, 64, 1, 1), bias shape = (256,) converting layer fire8_expand3x3, wmat shape = (256, 64, 3, 3), bias shape = (256,) converting layer fire9_squeeze1x1, wmat shape = (64, 512, 1, 1), bias shape = (64,) converting layer fire9_expand1x1, wmat shape = (256, 64, 1, 1), bias shape = (256,) converting layer fire9_expand3x3, wmat shape = (256, 64, 3, 3), bias shape = (256,) converting layer conv10, wmat shape = (2, 512, 1, 1), bias shape = (2,)

Also, in trace last layer seems to be creating 2 classes (not 18) Where am I possibly going wrong? Any help appreciated.

Thanks

gaush123 avatar May 06 '16 09:05 gaush123

I was able to solve the above issue. There was some issue due to kernel_size in global pooling layer. Extra padding in convolution layer was causing more no. of filter maps than required.

Now, I am stuck at another issue in the same architecture which causes all the probabilities to be 1.0 for all the classes in output, what could be the possible reason? Any help appreciated!

gaush123 avatar May 09 '16 13:05 gaush123

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

phunterlau avatar Sep 28 '17 05:09 phunterlau