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

Android app #20

Open
shadow111 opened this issue Mar 6, 2018 · 6 comments
Open

Android app #20

shadow111 opened this issue Mar 6, 2018 · 6 comments

Comments

@shadow111
Copy link

Hello,
i'm asking about the android app because i want to develop it, so please can you give me some details about what things i have to do and what script needed to be ported from python to java.
Thanks
Lafi

@akashdexati
Copy link

@shadow111
Were you able to have a proper model for android ?

@akirasosa
I converted the .h5 to .pb with tf-converter.py.
The pb runs very well on desktop. But the android code is not able to load the model.
Error is :
Caused by: java.io.IOException: Not a valid TensorFlow Graph serialization: NodeDef mentions attr 'dilations' not in Op output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]>; NodeDef: conv_0/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true](input_1, conv_0/kernel/read). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary

Any clue on this ?

@akashdexati
Copy link

akashdexati commented Apr 11, 2018

Hi @akirasosa
I have solved above issue. The model can be loaded but here's another problem :
No Operation named [hair_recognition/input_1] in the Graph

What I could think is something is different in tf-converter.py . Any help on what could be the possible remedy for this ?

@shadow111
Copy link
Author

CAN YOU SHARE your model please, so i can debug it

@hiepgaf
Copy link

hiepgaf commented Aug 4, 2018

Use:
private final static String INPUT_NAME = "input_1:0"; private final static String OUTPUT_NAME = "output_0:0";
And i got Exeption:
Caused by: java.lang.IllegalArgumentException: Expects arg[0] to be float but uint8 is provided at org.tensorflow.Session.run(Native Method) at org.tensorflow.Session.access$100(Session.java:48) at org.tensorflow.Session$Runner.runHelper(Session.java:298) at org.tensorflow.Session$Runner.runAndFetchMetadata(Session.java:260) at org.tensorflow.contrib.android.TensorFlowInferenceInterface.run(TensorFlowInferenceInterface.java:220) at org.tensorflow.contrib.android.TensorFlowInferenceInterface.run(TensorFlowInferenceInterface.java:197)
Any help this model to run on Android?

@akirasosa
Copy link
Owner

It's TODO now.

@jaswant-iotric
Copy link

It's in TODO for last 5 years.

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

5 participants