# ConverterError: TFLite conversion failed: quantization for model layer 'conv2d' failed

- **ID:** `tensorflow/tflite-conversion-quantization-failed`
- **Domain:** tensorflow
- **Category:** build_error
- **Error Code:** `ETFLITE`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The model contains operations or data types that are not supported by TFLite's post-training quantization, such as unsupported activations or dynamic ranges.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| tensorflow 2.10 | active | — | — |
| tensorflow 2.11 | active | — | — |
| tensorflow 2.12 | active | — | — |
| tflite 2.10 | active | — | — |
| tflite 2.11 | active | — | — |

## Workarounds

1. **Use selective quantization: converter.optimizations = [tf.lite.Optimize.DEFAULT]; converter.target_spec.supported_types = [tf.float16]; then convert.** (85% success)
   ```
   Use selective quantization: converter.optimizations = [tf.lite.Optimize.DEFAULT]; converter.target_spec.supported_types = [tf.float16]; then convert.
   ```
2. **Disable quantization for problematic layers: converter.optimizations = [] and convert without optimization.** (90% success)
   ```
   Disable quantization for problematic layers: converter.optimizations = [] and convert without optimization.
   ```
3. **Replace unsupported ops with TFLite-compatible alternatives, e.g., replace tf.nn.relu6 with tf.nn.relu.** (80% success)
   ```
   Replace unsupported ops with TFLite-compatible alternatives, e.g., replace tf.nn.relu6 with tf.nn.relu.
   ```

## Dead Ends

- **** — The converter cannot handle the incompatible ops, leading to crashes. (90% fail)
- **** — The model structure may not support post-conversion quantization. (80% fail)
