mobile-semantic-segmentation icon indicating copy to clipboard operation
mobile-semantic-segmentation copied to clipboard

Android app

Open shadow111 opened this issue 6 years ago • 6 comments

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

shadow111 avatar Mar 06 '18 14:03 shadow111

@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 avatar Apr 11 '18 05:04 akashdexati

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 ?

akashdexati avatar Apr 11 '18 12:04 akashdexati

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

shadow111 avatar Apr 11 '18 12:04 shadow111

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?

hiepgaf avatar Aug 04 '18 17:08 hiepgaf

It's TODO now.

akirasosa avatar Nov 10 '18 03:11 akirasosa

It's in TODO for last 5 years.

jaswant-iotric avatar Sep 30 '23 11:09 jaswant-iotric