DSFD-tensorflow icon indicating copy to clipboard operation
DSFD-tensorflow copied to clipboard

how to conver to tflite

Open fangxiaoying opened this issue 3 years ago • 0 comments

I want to convert Lightnet_0.75 to tflite and quant to deploy it on NPU.

input_shape=(320,320,3)

saved_model_dir='./model/Lightnet_0.75/detector' saved_model_dir_for_lite=saved_model_dir+'lite_pre'

we build the tflite version detect firstly, then save it

model=DSFDLite(input_shape) model.load_weights(saved_model_dir+'/variables/variables') tf.saved_model.save(model,saved_model_dir_for_lite)

print('the model rebuild over, ')

but meet error.ValueError: Tensor's shape (1, 1, 16, 32) is not compatible with supplied shape (1, 1, 24, 24)

How to fix? thank!

fangxiaoying avatar Aug 09 '21 07:08 fangxiaoying