chuanqi305 / MobileNetv2-SSDLite

Caffe implementation of SSD and SSDLite detection on MobileNetv2, converted from tensorflow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Questuion: model reshaping caffe model in dump_tensorflow_weights.py

ShihweiChen opened this issue · comments

Is there anybody able to explain why in dump_tensorflow_weights.py:
(1) line 67:
caffe_weights = data.transpose(3, 2, 0, 1)
(2) line 85-86:
new_weights[:, 0] = tmp[:, 1] * 0.5
new_weights[:, 1] = tmp[:, 0] * 0.5

In (1), I know tensorflow uses NHWC format and caffe uses NCHW format so that I cannot realize why transposes (3,2,0,1)

In(2), sincerely request a help to know why it has to make new caffe weight a half of old caffe weight if BoxPredictor_0/BoxEncodingPredictor/weights