Questions tagged [tensorflow-lite]

TensorFlow Lite is a toolkit for Android and iOS that provides Machine Learning capabilities on-device.

TensorFlow Lite is a tool developed by Google that lets developers use some of on-device features of TensorFlow on Android or iOS.

Resources

2176 questions
31
votes
1 answer

Description of TF Lite's Toco converter args for quantization aware training

These days I am trying to track down an error concerning the deployment of a TF model with TPU support. I can get a model without TPU support running, but as soon as I enable quantization, I get lost. I am in the following situation: Created a…
DocDriven
  • 3,726
  • 6
  • 24
  • 53
31
votes
3 answers

How can I test a .tflite model to prove that it behaves as the original model using the same Test Data?

I have generated a .tflite model based on a trained model, I would like to test that the tfilte model gives the same results as the original model. Giving both the same test data and obtaining the same result.
Jorge Jiménez
  • 678
  • 1
  • 7
  • 22
28
votes
4 answers

Cannot run tflite model on GPU (Jetson Nano) using Python

I have a quantized tflite model that I'd like to benchmark for inference on a Nvidia Jetson Nano. I use tf.lite.Interpreter() method for inference. The process doesn't seem to run on the GPU as the inference times on both CPU and GPU are the…
nithinsubbiah
  • 390
  • 3
  • 7
25
votes
2 answers

How to load a tflite model in script?

I have converted the .pb file to tflite file using the bazel. Now I want to load this tflite model in my python script just to test that weather this is giving me correct output or not ?
Harshit Mishra
  • 271
  • 1
  • 3
  • 6
19
votes
3 answers

(-5:Bad argument) in function 'rectangle' - Can't parse 'pt1'. Sequence item with index 0 has a wrong type

As I detect my tflite file, the problem happened. The command I wrote. python detect.py --weights ./checkpoints/yolov4-tiny-tf.tflite --size 416 --model yolov4 --image D:\yolov4\training\tensorflow-yolov4-tflite-master\data\rice.jpg --framework…
CYH
  • 345
  • 1
  • 2
  • 9
19
votes
1 answer

Why is TensorFlow Lite slower than TensorFlow on desktop?

I'm currently working on Single Image Superresolution and I've managed to freeze an existing checkpoint file and convert it into tensorflow lite. However, when performing inference using the .tflite file, the time taken to upsample one image is at…
tehtea
  • 316
  • 3
  • 12
19
votes
2 answers

tensorflow lite model gives very different accuracy value compared to python model

I am using tensorflow 1.10 Python 3.6 My code is based in the premade iris classification model provided by TensorFlow. This means, I am using a Tensorflow DNN premade classifier, with the following difference: 10 features instead 4. 5 classes…
Jorge Jiménez
  • 678
  • 1
  • 7
  • 22
18
votes
7 answers

Gradle - Null extracted folder for artifact: ResolvedArtifact

I've the following line in my gradle android project inside the module build.gradle dependencies { // a lot of dependencies implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:0.0.0-nightly-SNAPSHOT' } and it causes the gradle build to…
Daniel Botnik
  • 539
  • 1
  • 6
  • 20
18
votes
2 answers

TensorFlow Lite C++ API example for inference

I am trying to get a TensorFlow Lite example to run on a machine with an ARM Cortex-A72 processor. Unfortunately, I wasn't able to deploy a test model due to the lack of examples on how to use the C++ API. I will try to explain what I have achieved…
DocDriven
  • 3,726
  • 6
  • 24
  • 53
16
votes
12 answers

How to convert .pb to TFLite format?

I downloaded a retrained_graph.pb and retrained_labels.txt file of a model I trained in Azure cognitive service. Now I want to make an Android app using that model and to do so I have to convert it to TFLite format. I used toco and I am getting the…
Ayush Saxena
  • 165
  • 1
  • 1
  • 14
15
votes
1 answer

How to build TensorFlow Lite as a static library and link to it from a separate (CMake) project?

I've successfully built a simple C++ app running TF Lite model by adding my sources to tensorflow/lite/examples, similarly to what the official C++ TF guide suggests for full TF. Now I want to build it as a separate project (shared library) linking…
Andrii Zymohliad
  • 1,237
  • 1
  • 11
  • 17
14
votes
10 answers

OSError: SavedModel file does not exist at: C:\Users\Munib\New folder/{saved_model.pbtxt|saved_model.pb}

I wanted to use my keras trained model in android studio. I got this code on internet to convert my code from keras to tensorflow-lite. But when i tried code i got this error: OSError: SavedModel file does not exist at: C:\Users\Munib\New…
Mirza Munib
  • 273
  • 1
  • 5
  • 15
14
votes
5 answers

how to fix "There is at least 1 reference to internal data in the interpreter in the form of a numpy array or slice" and run inference on tf.lite

I'm trying to run inference using tf.lite on an mnist keras model that I optimized by doing post-training-quantization according to this RuntimeError: There is at least 1 reference to internal data in the interpreter in the form of a numpy array or…
theroguecode
  • 191
  • 2
  • 6
13
votes
2 answers

how to convert saved model from sklearn into tensorflow/lite

If I want to implement a classifier using the sklearn library. Is there a way to save the model or convert the file into a saved tensorflow file in order to convert it to tensorflow lite later?
13
votes
1 answer

What is the correct way to create representative dataset for TFliteconverter?

I am trying to infer tinyYOLO-V2 with INT8 weights and activation. I can convert the weights to INT8 with TFliteConverter. For INT8 activation, I have to give representative dataset to estimate the scaling factor. My method of creating such dataset…
Damodharan_C
  • 313
  • 1
  • 2
  • 11
1
2 3
99 100