mdietrichstein / tensorflow-open_nsfw

Tensorflow Implementation of Yahoo's Open NSFW Model
Other
430 stars 136 forks source link

Need help to run this model on android #19

Open ameerhamza6733 opened 5 years ago

ameerhamza6733 commented 5 years ago

I am trying to run this model on the Android device.i think I have made some mistake here can you please review these value and let me know I these values are correct or not

Error : E/TensorFlowInferenceInterface: Failed to run TensorFlow inference with inputs:[input], outputs:[predictions]

Please reply Thank you.

        private const val INPUT_WIDTH = 224
        private const val INPUT_HEIGHT = 224
        private const val IMAGE_MEAN = 117
        private const val IMAGE_STD = 1f
        private const val INPUT_NAME = "input"
        private const val OUTPUT_NAME = "predictions"
ashik-e-rabbani commented 5 years ago

Make sure your android INPUT_NAME and OUTPUT_NAME should be the same of your training time name.

ameerhamza6733 commented 5 years ago

Yes it is same, Here is input layer name in the model https://github.com/mdietrichstein/tensorflow-open_nsfw/blob/master/model.py#L34 output name : https://github.com/mdietrichstein/tensorflow-open_nsfw/blob/master/model.py#L107

ashik-e-rabbani commented 5 years ago

Yes it is same, Here is input layer name in the model https://github.com/mdietrichstein/tensorflow-open_nsfw/blob/master/model.py#L34 output name : https://github.com/mdietrichstein/tensorflow-open_nsfw/blob/master/model.py#L107

https://github.com/tensorflow/tensorflow/issues/10153#issuecomment-346284237 check this out

ameerhamza6733 commented 5 years ago

I use google colab to convert this model to tflie. Now when I run this tflite on my android device it always returns the first label with high probability any idea why?