0

I am trying to input nude detection feature for my app using tensorflow lite.

I found a data set that suitable for my integration. But I have zero experience on python and and tensorflow. Now I need to convert this file into tflite. I used colab as a tool. and this is what i tried on the tool, But it did not work.

import tensorflow as tf
converter = tf.lite.TFLiteConverter.from_saved_model("classifier.py")
tflite_model = converter.convert()
with open('model.tflite', 'wb') as f: 
f.write(tflite_model)

Reference

I need help to convert this file to tflite

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Isuru Bandara
  • 310
  • 1
  • 3
  • 14
  • 1
    "*It did not work*" is not much helpful for possible respondents; what *exactly* is the issue you are facing? Please post a [mre]. – desertnaut May 31 '21 at 20:32
  • 2
    classifier.py is not a model, is a python file that loads a model from https://github.com/notAI-tech/NudeNet/releases/download/v0/classifier_model.onnx. this answer https://stackoverflow.com/a/63442788/9983880 shows how to convert an onnx model to a tensorflowlite model – sebrojas May 31 '21 at 20:35
  • @desertnaut , I did not add the error because, I have no experience on python, Even you say how to solve that error, I won't be able solve that. After that I might face more errors. Thats why I wanted to know prefect way to do that from an expert. – Isuru Bandara Jun 01 '21 at 06:03
  • hey, did you find it? i am also search for it. – Adil Shinwari Feb 24 '23 at 19:55

0 Answers0