akirasosa / mobile-semantic-segmentation

Real-Time Semantic Segmentation in Mobile device
MIT License
715 stars 135 forks source link

Android app #20

Open shadow111 opened 6 years ago

shadow111 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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

hiepgaf commented 6 years ago

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 commented 6 years ago

It's TODO now.

jaswant-iotric commented 1 year ago

It's in TODO for last 5 years.