-
Notifications
You must be signed in to change notification settings - Fork 45.9k
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
[Object Detection TFlite] Converting ssdlite_mobilenet_v2_coco #5122
Comments
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. |
Screwed up the formatting sorry, System information
|
as a side note, the model ran on pc and tfmobile |
Mobilenet V2 should be supported by TFLite. Looking at the pipeline.config file for this model, I note that |
Oh I didn't know ssdlite mobilenet v2 uses logit. But does this also explain why the class nodes is outputting negative decimal numbers? I understand that I can then convert logit output nodes for the scores into probabilities but what does this mean for the class nodes? |
Try applying logits to both. |
I'm sorry @derekjchow but I'm kinda lost here. As I understand logits are just different representation of probabilties ranging from R - infinity to infinity which I can then convert to a distribution from 0 to 1. What do you mean by applying logits to both? how am I supposed to apply logit to the class nodes? |
Can anyone confirm whether this is an issue with the API or with my implementation? |
I was able to get this to work today by using the config files inside research/object_detection/samples/configs/ssdlite_mobilenet_v2_coco.config After comparing the two config file the only difference that I can find is some numbers are ever so slightly different, for example droupout_keep_probablity was 0.8 in the samples and it was 0.800000011921 in the file I got from the model zoo. I'm not sure wether this has been mentioned somewhere before. |
seems like the model still outputs negative index sometimes, but for the most part a simple if statement to check seems to do the job for now |
@normandra I get a negative location bbox, and the score is very different with PC model, I turn to ssd_mobilenet_v1 and test, hope will have a fine resut. |
@WuDanFly yeah I ended up using that aswell. What mentioned before by derekjchow is probably regarding the export model part, which I only understand now due to my lack of understanding of ml / tensorflow in general. I'm just gonna assume that doing so will probably fix the problem. |
@normandra Finally I found the cause of the problem. I used the C++ API in tflite and python in pb model, |
System information
Describe the problem
After retraining the model (http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz) I went through the steps to produce a tflite version to run on android. As I understand the model is a float model and I converted it as such. While the conversion worked after testing on android the results is just wrong. Not only is it random, it also gives negative decimal numbers for the class nodes. Is this model currently not supported for tflite or have I possibly made a mistake somewhere?
The code for android is taken from the tflite demo, set to float (unquantized)
upon request I can upload the model ( the whole thing or just specific part )
EDIT: tf version is 1.10 not 1.1
The text was updated successfully, but these errors were encountered: