Open leon-liangwu opened 7 years ago
@chuanqi305
@chuanqi305 I tested your pretrained model on ImageNet dataset. I only got 0.42 accuracy. Why?
Because the 'Relu6', I replaced Relu6 by Relu layer.
@DreamHorse0301 The script is only for mobilenet, not a universal converting script.
@chuanqi305 Thanks. I've figured out how to convert mobilenet to caffemodel, and converted the 0.75 version. But I still have some concern that I change relu layer to make relu output smaller than 6 and the accuracy does not show any better.
@DreamHorse0301 There is a little difference about the 3x3 Convolution's 'pad' parameter. Here is the padding of tensorflow's mobilenet:
conv0:stride=2, output=150x150, pad=(0, 0, 1, 1)
conv1:stride=1, output=150x150, pad=(1, 1, 1, 1)
conv2:stride=2, output=75x75, pad=(0, 0, 1, 1)
conv3:stride=1, output=75x75, pad=(1, 1, 1, 1)
conv4:stride=2, output=38x38, pad=(1, 1, 1, 1)
conv5:stride=1, output=38x38, pad=(1, 1, 1, 1)
conv6:stride=2, output=19x19, pad=(0, 0, 1, 1)
conv7:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv8:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv9:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv10:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv11:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv12:stride=2, output=10x10, pad=(1, 1, 1, 1)
conv13:stride=1, output=10x10, pad=(1, 1, 1, 1)
But in caffe, the padding of left,top,right,bottom must be the same. So the padding is:
conv0:stride=2, output=150x150, pad=(1, 1, 1, 1)
conv1:stride=1, output=150x150, pad=(1, 1, 1, 1)
conv2:stride=2, output=75x75, pad=(1, 1, 1, 1)
conv3:stride=1, output=75x75, pad=(1, 1, 1, 1)
conv4:stride=2, output=38x38, pad=(1, 1, 1, 1)
conv5:stride=1, output=38x38, pad=(1, 1, 1, 1)
conv6:stride=2, output=19x19, pad=(1, 1, 1, 1)
conv7:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv8:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv9:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv10:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv11:stride=1, output=19x19, pad=(1, 1, 1, 1)
conv12:stride=2, output=10x10, pad=(1, 1, 1, 1)
conv13:stride=1, output=10x10, pad=(1, 1, 1, 1)
@chuanqi305 Hi, how about your result when you use the converted caffemodel to test on ImageNet dataset.
你好 传奇305,
能否分享一下你的这个脚本?
感激万分。