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

dump_tensorflow_weights.py with error

Open he-chen opened this issue 6 years ago • 2 comments

i run the following command :python3 dump_tensorflow_weights.py and get this error: Traceback (most recent call last): File "dump_tensorflow_weights.py", line 95, in tmp = caffe_weights.reshape(boxes, -1).copy() TypeError: 'float' object cannot be interpreted as an integer

i fix it by change the code at line 71

if output_name.find('BoxEncodingPredictor') != -1: boxes = caffe_weights.shape[0] / 4 elif output_name.find('ClassPredictor') != -1: boxes = caffe_weights.shape[0] / 91

to

if output_name.find('BoxEncodingPredictor') != -1: boxes = caffe_weights.shape[0] // 4 elif output_name.find('ClassPredictor') != -1: boxes = caffe_weights.shape[0] // 91

and i wonder if it is ok or not ?

he-chen avatar Aug 21 '18 14:08 he-chen

it ok! this script is write by python2, if you use python3,should change '/' to '//'

zhanghanbin3159 avatar Sep 05 '18 07:09 zhanghanbin3159

@he-chen Thank you very much, I have merged your code to my project.

chuanqi305 avatar Oct 10 '18 01:10 chuanqi305