Mobilenet 通道数为什么是8的整数倍?

2021-08-02 02:56

阅读:683

问题 今天阅读一段 PyTorch 版的 mobilenet 时,发现了下面这个函数: def _make_divisible(v, divisor, min_value=None): """ This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py :param v: :param divisor: :param min_value: :return: """ if min_value is None: min_value = divisor new_v = max(min_value, int(v + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_v


评论


亲,登录后才可以留言!