Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert tflite with mask rcnn #4

Closed
kewin1807 opened this issue Feb 21, 2020 · 9 comments
Closed

Convert tflite with mask rcnn #4

kewin1807 opened this issue Feb 21, 2020 · 9 comments

Comments

@kewin1807
Copy link

How can you convert to mask rcnn to tflite model. Thanks

@PINTO0309
Copy link
Owner

@kewin1807
Copy link
Author

Thanks. I will try. Have you use model which can be converted from this script =)

@PINTO0309
Copy link
Owner

No, I'm a weird, so I'm just enjoying the conversion for now.

@kewin1807
Copy link
Author

i see the error "Invalid tensors 'image_tensor' were found." Can you solve it ??

@kewin1807
Copy link
Author

Check failed: array.data_type == array.final_data_type Array "image_tensor" has mis-matching actual and final data types (data_type=uint8, final_data_type=float).
Can you solve it ??

@PINTO0309
Copy link
Owner

First, you need to change the placeholder in the Python code of the model from UInt8 to Float32. I'll share the code with you when I have time, but I'm pretty busy and I don't have enough time to work, so please wait a bit.

@kewin1807
Copy link
Author

yeah. i fixed it. But when i load the model tflite. i have a problem "Encountered unresolved custom op: Enter.Node number 0 (Enter) failed to prepare."

Can you solve it ?? Thanks

@PINTO0309
Copy link
Owner

PINTO0309 commented Feb 29, 2020

Two days ago, it seems that the mask r-cnn correspondence was committed to the master branch. So, today I tried to regenerate the weight quantization model using the latest Tensorflow. Operation has not been confirmed.
https://github.com/PINTO0309/PINTO_model_zoo/blob/master/08_mask_rcnn_inceptionv2/02_weight_quantization/mask_rcnn_inception_v2_coco_256_weight_quant.tflite

The installation of the Tensorflow v2.1.0 master I built is as follows.
https://drive.google.com/open?id=1EqkpK_FIWM5flUK-7Z3au9SkavMCvBrY

Below is the script of Weight Quantization.
https://github.com/PINTO0309/PINTO_model_zoo/blob/master/08_mask_rcnn_inceptionv2/01_float32/03_weight_quantization.py

@PINTO0309
Copy link
Owner

@hoangtubatu123 hoangtubatu123
I was able to successfully convert without a custom OP with Tensorflow v2.2.0-rc3 (Tensorflow Lite). If you feel like it, give it a try.
https://github.com/PINTO0309/PINTO_model_zoo/tree/master/08_mask_rcnn_inceptionv2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants