keras-team/keras · error · ValueError
Unrecognized format={format}. Supported formats are: {list(a
Error message
Unrecognized format={format}. Supported formats are: {list(available_formats)}. What it means
Error "Unrecognized format={format}. Supported formats are: {list(available_formats)}." thrown in keras-team/keras.
Source
Thrown at keras/src/models/model.py:940
loaded_program = torch.export.load("path/to/model.pt2")
predictions = loaded_program.module()(input_tensor)
```
"""
from keras.src.export import export_litert
from keras.src.export import export_onnx
from keras.src.export import export_openvino
from keras.src.export import export_saved_model
from keras.src.export import export_torch
available_formats = (
"tf_saved_model",
"onnx",
"openvino",
"litert",
"torch",
)
if format not in available_formats:
raise ValueError(
f"Unrecognized format={format}. Supported formats are: "
f"{list(available_formats)}."
)
# Check if LiteRT export is available (requires TensorFlow or
# PyTorch backend)
if format == "litert" and backend.backend() not in (
"tensorflow",
"torch",
):
raise ValueError(
"LiteRT export requires TensorFlow or PyTorch backend."
)
# Check if Torch export is available (requires PyTorch backend)
if format == "torch" and backend.backend() != "torch":
raise ValueError("Torch export requires PyTorch backend.")
View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/models/model.py:940 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25).
Data as JSON: /api/errors/1fb88bab0fe143cc.
Report an issue: GitHub.