Questions tagged [quantization]

Use this tag for questions related to quantization of any kind, such as vector quantization.

Quantization, in mathematics and digital signal processing, is the process of mapping a large set of input values to a (countable) smaller set.

For more, please read the Wikipedia article for more.

444 questions
0
votes
1 answer

Quantize an image with 8 selected colors (JavaScript)

I am writing a code that takes an image and quantizes it with the 8 selected colors that I have chosen. What I am wanting the program to do is to find a color that is closest with one of the 8 colors that I have chosen in my array and replace that…
clkhlum02
  • 57
  • 8
0
votes
1 answer

tensorflow-lite tf.lite.Interpreter set_tensor failing to properly recognize uint8 input tensors

I have a working .tflite model (which takes 180x180 float greyscale image) as input, and returns 6 float sigmoid outputs. All works as-expected yielding expected results with test images. I am trying to quantize .tflite model to uint8. Notice I am…
Brad
  • 11,262
  • 8
  • 55
  • 74
0
votes
0 answers

Perform "fake" quantization on torch tensor

I'm working on something called Federated Learning. In this project, resource constraints are simulated, and the local model updates thus have to be compressed. This does not have to be efficient in any way, we just want to see the effects that this…
JarrList
  • 1
  • 1
0
votes
1 answer

how to confirm if the weights of my pytorch model has been quantized

I was able to successfully quantise a pytorch model for huggingface text classification with intel lpot(neural compressor) I now have the original fp32 model and quantised int8 models in my machine. For inference I loaded the quantised lpot model…
ArunJose
  • 1,999
  • 1
  • 10
  • 33
0
votes
1 answer

TFLite input/output quantization in multiple signatures

TFLite model conversion allows to automatically quantize or dequantize inputs or outputs of the model. You can do this by setting inference_input_type and inference_output_type appropriately like this. converter =…
user3176103
  • 195
  • 1
  • 9
0
votes
2 answers

how do I prevent from the actual pytorch model not to be converted to ipex

I have been trying out intel extension for pytorch(ipex) to optimise my inference. I am using a pretrained model from torchvision. I wanted to compare improvement with and without ipex so I created a copy of model converted it to ipex. Now I try to…
ArunJose
  • 1,999
  • 1
  • 10
  • 33
0
votes
1 answer

How to convert the model with grid_sample to TensorRT with INT8 quantization?

I am trying to convert the model with torch.nn.functional.grid_sample from Pytorch (1.9) to TensorRT (7) with INT8 quantization throught ONNX (opset 11). Opset 11 does not support grid_sample conversion to ONNX. Thus I used ONNX graphsurgeon…
0
votes
1 answer

Cannot load tflite model, Did not get operators or tensors in subgraph 1

I have converted a tf model to tflite, and applied quantization in the process, but I cannot load it. The error was raised when I try to do interpreter = tf.lite.Interpreter(tflite_model_path), the error message was: ValueError: Did not get…
Hongtao Yang
  • 381
  • 3
  • 14
0
votes
1 answer

Reducing the size of a tensorflow model file

I have an TensorFlow model which basically classifies stuff into X-rays and Not X-rays. My problem is that the TensorFlow model file(for that model) is a whopping 123mb big, and I need to reduce the size of it somehow. I saw an answer here on Stack…
0
votes
1 answer

TFLite Quantized Model still outputs floats

I have a CNN already working, but now it is necessary to put it in some specific hardware. For that, I've been told to quantize the model, since the hardware can only use integer operations. I read a good solution here: How to make sure that TFLite…
0
votes
1 answer

RuntimeError: tensorflow/lite/kernels/pad.cc:79 SizeOfDimension

So I have the following code snipped which works till the last line where i enter the interpreter.invoke() input_data10 = np.expand_dims(input_text[1:1001], axis=1) interpreter.resize_tensor_input(input_details[0]['index'], [1000, 1,…
Asim S
  • 1
  • 1
0
votes
0 answers

How to calculate the computation complexity of an artificial neural network after quantization

Could anyone suggest a way of defining the computational complexity of a neural network after quantization? I understand computation complexity as the amount of arithmetic “work” needed to calculate the entire network or a single layer.…
0
votes
1 answer

Is it impossible to quantization the .tflite file? (OSError Occurred)

I have to try the quantization to my model(tflite). I want to change float32 to float 16 through the dynamic range quantization. This is my code: import tensorflow as tf import json import sys import pprint from tensorflow import keras import numpy…
0
votes
2 answers

convert from saved model to quant. tflite, 'Quantization not yet supported for op: CUSTOM'

I read similar question, Tensorflow (TF2) quantization to full integer error with TFLiteConverter RuntimeError: Quantization not yet supported for op: 'CUSTOM' However it cannot resolve this at TF 2.4.1. I referred this tensorflow site to convert…
pipi
  • 1
0
votes
1 answer

Run inference with quantized tflite model "INT8" in Python

**Hello everyone, I converted a tensorflow float model to a tflite quantized INT8 model recently, in the end I got the model without errors. I want to do inferences with this model in python but I can't get good results. The code is as follows:…
Abid
  • 1
  • 1