matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.7k stars 11.71k forks source link

Quantising Mask_RCNN #1434

Open neoyipeng2018 opened 5 years ago

neoyipeng2018 commented 5 years ago

My aim is to implement this model in edge computing, and one thing i'm trying out is quantising the model.

I've converted the .h5 file into a tf frozen graph following this, but when I tried to post-training quantise it, I get the following error

ValueError: None is only supported in the 1st dimension. Tensor 'input_image' has invalid shape '[None, None, None, 3]'.

This is likely a limitation of tflite, but was wondering if anyone managed to bypass it? I inputted an arbitrary shape into the input image shapes, but it doesn't seem to work as well.

adithyadinesh96 commented 5 years ago

Same Issue

JonathanLehner commented 5 years ago

any updates on this?

davidvirdeforshh commented 5 years ago

I see the same error when converting from frozen graph to tensorflowlite.

bmabir17 commented 4 years ago

It seems to be a known limitation of tflite. As mask-rcnn uses ResizeNearestNeighbor, Stack, and TensorFlowShape tensorflow ops that is not supported with tflite yet. The tflite converter seems to have worked around it to by converter.target_ops = [tf.lite.OpsSet.TFLITE_BUILTINS,tf.lite.OpsSet.SELECT_TF_OPS]