tensorflow/models · error · ValueError
Not enought quantized model weights.
Error message
Not enought quantized model weights.
What it means
Error "Not enought quantized model weights." thrown in tensorflow/models.
Source
Thrown at official/projects/qat/vision/quantization/helper.py:92
raise ValueError('Variable name {} is not supported.'.format(simple_name))
def copy_original_weights(original_model: tf_keras.Model,
quantized_model: tf_keras.Model):
"""Helper function that copy the original model weights to quantized model."""
original_weight_value = original_model.get_weights()
weight_values = quantized_model.get_weights()
original_idx = 0
for idx, weight in enumerate(quantized_model.weights):
if not is_quantization_weight_name(weight.name):
if original_idx >= len(original_weight_value):
raise ValueError('Not enought original model weights.')
weight_values[idx] = original_weight_value[original_idx]
original_idx = original_idx + 1
if original_idx < len(original_weight_value):
raise ValueError('Not enought quantized model weights.')
quantized_model.set_weights(weight_values)
class LayerQuantizerHelper(object):
"""Helper class that handles quantizers."""
def __init__(self, *args, **kwargs):
self._quantizers = {}
self._quantizer_vars = {}
super().__init__(*args, **kwargs)
def _all_value_quantizer(self):
return tfmot.quantization.keras.quantizers.AllValuesQuantizer(
num_bits=8, per_axis=False, symmetric=False, narrow_range=False)
def _moving_average_quantizer(self):
return tfmot.quantization.keras.quantizers.MovingAverageQuantizer(View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/qat/vision/quantization/helper.py:92 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24).
Data as JSON: /api/errors/317049e16895841b.
Report an issue: GitHub.