MobileNetv2-SSDLite
MobileNetv2-SSDLite copied to clipboard
dump_tensorflow_weights.py with error
BoxPredictor_1/BoxEncodingPredictor/weights Traceback (most recent call last): File "dump_tensorflow_weights.py", line 54, in <module> tmp = caffe_weights.reshape(n, 4, -1) ValueError: cannot reshape array of size 276480 into shape (68,4,newaxis)
The bug seems at line 53
n = caffe_bias.shape[0] / 4
maybe have to be changed as
n = caffe_weights.shape[0] / 4
@itemhsu Make sure your model is ssd_mobilenetv2_coco
File "dump_tensorflow_weights.py", line 77, in
my model is same ssd_mobilenet_v2_coco_2018_03_29
for those who need an answer; your model may have different number of classes than coco. try replacing the 91 value with your number of classes +1.
For example, if you have 20 classes, then with background class you will use 21.
Replace following lines (there are two of them):
boxes = caffe_bias.shape[0] // 91
to boxes = caffe_bias.shape[0] // 21