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

iOS example with Image Retraining model always gives the same prediction #3446

Closed
Tugees opened this issue Jul 21, 2016 · 1 comment
Closed
Assignees

Comments

@Tugees
Copy link

Tugees commented Jul 21, 2016

Environment info

Running on: iOS 9.1
Building on OS X El Capitan version 10.11, Xcode version 7.3.1
TensorFlow release 0.9

Steps to reproduce

Follow the contrib/makefile/README to install the tensorflow iOS core lib
Create my own model with the Image Retraining tutorial
Run the iOS example, same error as #2883 is logged.
After fixing errors as suggested same prediction is always given.
Logs or other output that would be helpful

2016-07-21 18:20:06.582 tf_ios_makefile_example[949:323060] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x17594000 V:|-(20)-[UIInputSetContainerView:0x176b59d0]   (Names: '|':UITextEffectsWindow:0x17597ab0 )>",
    "<NSLayoutConstraint:0x17593e30 'UIInputWindowController-top' V:|-(0)-[UIInputSetContainerView:0x176b59d0]   (Names: '|':UITextEffectsWindow:0x17597ab0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x17594000 V:|-(20)-[UIInputSetContainerView:0x176b59d0]   (Names: '|':UITextEffectsWindow:0x17597ab0 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-07-21 18:20:08.017 tf_ios_makefile_example[949:323060] 1
2016-07-21 18:20:16.855 tf_ios_makefile_example[949:323060] Image path: /var/mobile/Containers/Data/Application/3AEB6ED8-B068-45FA-85D3-36FCFFA21DD1/Documents/photos/image.jpg
I ../tensorflow/contrib/ios_examples/simple/RunModelViewController.mm:302] Session created.
I ../tensorflow/contrib/ios_examples/simple/RunModelViewController.mm:305] Graph created.
I ../tensorflow/contrib/ios_examples/simple/RunModelViewController.mm:310] Creating session.
W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().
2016-07-21 18:20:25.542 tf_ios_makefile_example[949:323060] Received memory warning.
2016-07-21 18:20:25.653 tf_ios_makefile_example[949:323060] Received memory warning.
2016-07-21 18:20:38.698 tf_ios_makefile_example[949:323060] Received memory warning.
I ../tensorflow/contrib/ios_examples/simple/RunModelViewController.mm:410] Predictions: 259 4.32 n01342269  moneran, moneron
10 3.69 n00141669   check-in
800 3.67 n01601410  great bowerbird, Chlamydera nuchalis
552 3.59 n01531811  redpoll, Carduelis flammea
0 3.58 n00004475    organism, being

Related to

#2883 I encountered the same error related to DecodeJpeg and then followed the fixes suggested there, but I get the same prediction no matter what I point the camera at. Similarly if i work with the "simple" project and change the photo being identified I still get the same prediction that in the log output above

@petewarden
Copy link
Contributor

I've got an example of how to successfully load and run a retrained model here:
https://petewarden.com/2016/09/27/tensorflow-for-mobile-poets/

I'm going to close this bug, since I believe it's fixed now, please reopen if you're still hitting problems.

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