-
Notifications
You must be signed in to change notification settings - Fork 125
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
Resize Nearest Neighbor does not convert #187
Comments
@rajansaini691 Thanks for reaching out! I'm also interested on your approach to this model, would be awesome if you could share :) |
@rajansaini691 |
@Namburger You'll find this very interesting. It turns out that the edgetpu compiler fully compiles the tflite model here, which goes on to run in 27 ms! I then followed their instructions to create a retrained model for our dataset. It was a very convoluted process, but I ended up with a tflite model that was nearly identical node-for-node. The only difference was that my ResizeNearestNeighbor op has I am not sure why this is the case. I am guessing they used an older version of the TOCO converter, but my attempts at reverse-engineering their dev environment were not very fruitful. Anyway, if either of us can figure out how to set Also, your modifications really helped. Unfortunately we are still in the process of retraining and validating our model, so I may need to send you another file in a week or so :) |
@rajansaini691 I see, I have also been following that same guide, but have not been able to produce the same model :(
Totally, keep posting the model here, I'll help you compile it! |
But Why TF2.1 can support 4-D, I am confused. |
@ZhouKai90 do you mean tflite converter?
If you want me to compile your model with some experimental features, you can post here, I'll gladly compile it for you! |
I means if I install TF2.3 and use python script 'tf.lite.TFLiteConverter.from_saved_model()' to convert savedmodel to xxx.tflite. I got the "RESIZE_NEAREST_NEIGHBOR Operation version not supported" error info when i used edgetpu_compiler to compile the xxx.tflite . But if I downgraded the TF2.3 to TF2.1,the convert and compile worked perfectly without any error. |
In addition, I noticed the converter between TF2.3 and TF2.1. TF2.1 is TOCO, but TF2.3 is MLIR. |
Hi @Namburger thanks for your help. Would it be alright if you could convert this model with the new compiler? Also, if it isn't too much trouble, would it be alright if you could post its inference time? I want to make sure that my environment maximizes the detection speed. |
Here it is: tiny_yolo_test.tar.gz |
Hi @Namburger , would it be alright if you could compile this model as well? Also, I'm experimenting with different quantization strategies, so I may end up sending you a few (not more than 1 or 2 per day) in the near future. Is there anything I can do to make the process more streamlined for you? Or perhaps compile it myself, if the team's okay with that? |
tiny_yolo.tar.gz |
@rajansaini691 Where you able to fix this issue. Our model also takes around 2 secs to inference. |
Any news on this issue? I'm using Edge TPU Compiler version 15.0.340273435 (tf.version =>2.4.0) and it still gives me the message "Operation version not supported" if I try to use RESIZE_NEAREST_NEIGHBOR and RESIZE_BILINEAR. |
Hi @Namburger , @ZhouKai90 I solved the RESIZE_NEAREST_NEIGHBOR problem by 「correcting gen_image_ops.py」. Correcting points are below. As a side note, I eventually transformed the model under TF 2.2.0 condition and I was able to map all the inference proccessing |
This is still an issue with current versions, but one possible issue is input sizes. I have a UNet model that fails to map fully with a 256x256 input, but works fine with a 128x128. For reference, I tried exporting my model with Tensorflow 2.2 and compilation just fails without any reason:
Here's the output from v15 and TF 2.5.0, note none of the layers are mapped and also the log message is basically false? (the op should be supported regardless of runtime version)
And now 16 - which at least manages to map one of the layers and gives a cryptic error about the other 2:
As mentioned above, if I change the input size to be smaller then everything gets mapped. The compile time is also quite a lot faster.
@Namburger perhaps the compiler is failing to recognise situations where the input size is too large? Or is this symptomatic of another issue with the model? |
Hello again! I am attempting to adapt tiny yolo v3 to the edge tpu. My model quantizes and compiles, but it has inference times of ~1.5s. According to the logs, the
RESIZE_NEAREST_NEIGHBOR
op is not mapped to the edge device, which may account for the slowdown. What should I do to make the mapping successful and improve performance?I am also using the newest compiler version with tensorflow 2.3.
model
compiled model
logs
The text was updated successfully, but these errors were encountered: