chuanqi305 / MobileNetv2-SSDLite

Caffe implementation of SSD and SSDLite detection on MobileNetv2, converted from tensorflow.
MIT License
448 stars 231 forks source link

Questuion: model reshaping caffe model in dump_tensorflow_weights.py #42

Open ShihweiChen opened 5 years ago

ShihweiChen commented 5 years ago

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