0

I followed the steps mentioned in the codelab and generated optimized_graph.lite file successfully. As per documentation we need TensorFlow Lite model for inference in a mobile app in the form of a .tflite file.

How do we further generate the .tflite file?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Monica M
  • 161
  • 3
  • 12
  • before you execute the command to get the lite file try changing it's extension to --`output_file=tf_files/optimized_graph.tflite` or simply when you try to load the graph from your assets in android studio just use the .lite version and see if it works – user 007 Jun 13 '18 at 06:10
  • The demo doesn't work when the extension is changed to .tflite .It works fine with .lite file.However I need the .tflite for another app and not the codelab. – Monica M Jun 13 '18 at 06:21
  • I think it's safe to say the .lite file will work in other apps. Give it a try .. – user 007 Jun 13 '18 at 06:37

2 Answers2

2

The generated optimized_graph.lite is the tflite flatbuffer file. In this codelab, for some reason they chose to use the .lite filename extension as opposed to .tflite.

So simply copy the optimized_graph.lite file and rename it to optimized_graph.tflite and you should be able to use it further to upload to firebase console or place in the assets folder.

Pannag Sanketi
  • 1,372
  • 1
  • 10
  • 10
0

There is no such thing as .tflite file , i searched the codelab project and did not find anything called a .tflite file.You only require tf_files/optimized_graph.lite.

Dishonered
  • 8,449
  • 9
  • 37
  • 50
  • Yes the codelab demo works optimized_graph.lite But I need a tflite file for custom trained model which can be uploaded on firebase console or can be placed in the assets folder. – Monica M Jun 13 '18 at 06:18
  • Why do you a need a .tflite file? You can use the .lite file. – Dishonered Jun 13 '18 at 06:32