models icon indicating copy to clipboard operation
models copied to clipboard

MobileNetv1 depth_multiplier

Open voqtuyen opened this issue 8 years ago • 7 comments

def mobilenet_v1_base(inputs, final_endpoint='Conv2d_13_pointwise', min_depth=8, depth_multiplier=1.0, conv_defs=None, output_stride=None, use_explicit_padding=False, scope=None): what is depth_multiplier? Which one does it correspond to, width multiplier or resolution multiplier in mobilenetv1 paper?

voqtuyen avatar Apr 24 '18 04:04 voqtuyen

This should be the network's depth. It's not related to any width or resolution things. This imply the compression of mobilenet, and reduce the parameters of each model.

Please refer to https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md And you'll see how it changed in parameter and MACs.

lcycoding avatar Apr 24 '18 09:04 lcycoding

@lcycoding what does it mean, when for example depth_multiplier=0.5, the network's depth is reduced, but how? we would drop some layers to reduce the depth? In other words, we could reduce the number of parameters or computation cost of the model in what ways?

voqtuyen avatar Apr 26 '18 10:04 voqtuyen

For instance, the output channel of mobilenetv1 are 64 128 128 256 .... At certain condition, the multiplier will reduce the output channel to 32 64 64 128. ( For the very low multiplier condition, we should set a min_depth to prevent it from feature losing. ) It will obviously reduce the computation cost. Take single layer for example, 1x1x32x64 -> 1x1x32x32.

And if you're asking how this is implemented, you should look into the network_structure code.

lcycoding avatar Apr 26 '18 10:04 lcycoding

Hi @lcycoding,

How about output_stride?

output_stride: An integer that specifies the requested ratio of input to output spatial resolution. If not None, then we invoke atrous convolution if necessary to prevent the network from reducing the spatial resolution of the activation maps. Allowed values are 8 (accurate fully convolutional mode), 16 (fast fully convolutional mode), 32 (classification mode). use_explicit_padding: Use 'VALID' padding for convolutions, but prepad inputs so that the output dimensions are the same as if 'SAME' padding were used.

Could you help explain why we need that and what are practical uses?

voqtuyen avatar Apr 27 '18 02:04 voqtuyen

Well, I think the output stride is a special mechanism used in Image segmentation such as DeepLab network. You should understand the atrous convolution first, and then read paper about it.

Lastly, I'm not working at tensorflow team or google... There might be incorrect part in my answer.

lcycoding avatar Apr 27 '18 02:04 lcycoding

Hi @lcycoding,

Got it, really appreciate your help!

voqtuyen avatar Apr 27 '18 03:04 voqtuyen

Another useful resource to consider is stack overflow (https://stackoverflow.com/tags/tensorflow). Generally we triage these github issues prioritizing bug, stackoverflow may be able to give you more detailed help.

bitfort avatar Apr 27 '18 16:04 bitfort