-
Notifications
You must be signed in to change notification settings - Fork 74.6k
iOS example DecodeJpeg issue with Image Retraining model #2883
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
Comments
Sorry you're hitting problems! Since DecodeJpeg isn't supported as part of the core, you'll need to strip it out of the graph first. I'm working on a more user-friendly approach, but you should be able to run the strip_unused script on it, something like this:
Let me know if that helps. |
@petewarden |
Great! You should just need to update the input and output layer names to "Mul" and "final_result" respectively, here: |
Awesome! That fixed the last error, but now I'm getting:
|
Ah yes! The input sizes need to be 299, not 224. You'll also need to change the mean and std values both to 128. Here's the code I think you'll need:
We will be collecting this in proper documentation soon too, but thanks for testing this out. |
It worked! Thanks for all the help. |
Hi, I encountered the same errors and followed the suggestions. No longer getting any errors but I get the same prediction no matter what I point the camera at. What could be the problem? |
After going through the procedure told by Pete I am getting this result: |
Just to let folks in the future know, the above steps outlined by @petewarden well for me. I was using macOS Sierra, Xcode 8. |
worked for me as @petewarden instructions |
This is a lot of steps .. is there anything more "baked" / mature that is closer to working out of the box? |
petewarden's solutions work for me. There is an additional memory consumption error on iOS devices. I have added a comment here mortenjust/trainer-mac#3 and pete talks about it more here : |
@Zulqurnain24 The app is crashing due to apple force closing it due to the tf model taking up a lot of memory. Solution here : #4255 and ^ comment. |
Thanx @scm-ns I have followed these instructions https://petewarden.com/2016/09/27/tensorflow-for-mobile-poets/ to reduce the footprint of the graph file and now it is working fine |
Hi I follow all the steps, all the model can get the right answer using bazel, but I still get this error when I run on Android. |
I can reproduce the issue from @lxtGH
|
I fixed @lxtGH & @AlvarezAriel problem by running: |
Tried the quantize_graphy command by @jakublipinski to regenerate pb file. It doesn't solve 'negative output' issue in my case. |
I have changes All the file name and Size , but still getting below error. Source Code URL: Changes Code : const int wanted_input_width = 229; computed output size would be negative Please suggest what we are doing wrong . but created new pb and .txt is not working(rounded_graph.pb and retrained_labels.txt). |
@petewarden I used tf.image.decode_jpeg to read in images while training my model. I want to deploy my model on android. Since this decode_jpeg is not available on android, is there an alternate solution using opencv or other java libraries. The pixel values are different when I read in the input image using decode_jpeg compared to opencv. This results in the logits being different for the same image. How can I have the same behaviour on android? |
Environment info
Operating System: iOS
Steps to reproduce
Logs or other output that would be helpful
Running model failed:Invalid argument: No OpKernel was registered to support Op 'DecodeJpeg' with these attrs [[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=3, fancy_upscaling=true, ratio=1, try_recover_truncated=false](DecodeJpeg/contents)]]
Related to
#2754 except that I want to use the pd file generated from the Image Retraining tutorial
The text was updated successfully, but these errors were encountered: