0

Facing trouble in converting tensorflow model to tflite model throught command line on windows.

IMAGE_SIZE=224

tflite_convert \
  --graph_def_file=tf_files/retrained_graph.pb \
  --output_file=tf_files/optimized_graph.lite \
  --input_format=TENSORFLOW_GRAPHDEF \
  --output_format=TFLITE \
  --input_shape=1,${IMAGE_SIZE},${IMAGE_SIZE},3 \
  --input_array=input \
  --output_array=final_result \
  --inference_type=FLOAT \
  --input_data_type=FLOAT

it always gives the error

ModuleNotFoundError: No module named 'tensorflow.contrib.lite.python.tflite_convert'

trouble is doing with tflite_convert on windows.

Taha alam
  • 372
  • 3
  • 11
  • Possible duplicate of [Trying to convert TensorFlow model to TensorFlow lite, when running toco --help gives me an error](https://stackoverflow.com/questions/51340880/trying-to-convert-tensorflow-model-to-tensorflow-lite-when-running-toco-help) – Nico Haase Dec 14 '18 at 10:41
  • it is different as i am trying to solve my problem by tflite and not able to solve it – Taha alam Dec 14 '18 at 10:45
  • What version of tf? Try the nightly, maybe? Also you can try the python form of the converter – aselle Dec 14 '18 at 19:20

1 Answers1

0

When i got the same problem. I have solved it using tensorFlow nighty version. Here is the command which i used:

pip install tf-nightly

And here is the proper way of installing it in navigator env. tf-nighty

I hope this will be helpful.