MobileNetv2-SSDLite icon indicating copy to clipboard operation
MobileNetv2-SSDLite copied to clipboard

dump_tensorflow_weights.py with error

Open itemhsu opened this issue 6 years ago • 3 comments

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 avatar Apr 29 '18 09:04 itemhsu

@itemhsu Make sure your model is ssd_mobilenetv2_coco

chuanqi305 avatar Apr 30 '18 10:04 chuanqi305

File "dump_tensorflow_weights.py", line 77, in tmp = caffe_weights.reshape(boxes, -1).copy() ValueError: cannot reshape array of size 31104 into shape (0,newaxis)

my model is same ssd_mobilenet_v2_coco_2018_03_29

manoj652 avatar Sep 12 '18 12:09 manoj652

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

bkakilli avatar May 26 '20 04:05 bkakilli