tensorflow/models · error · ValueError
Model is not supported.
Error message
Model %s is not supported.
What it means
Dispatch guard in the detection model factory: params.type did not match any of the supported branches (retinanet, mask_rcnn, olnmask, shapemask), so no model class could be constructed. The params.type configuration string is the faulty input.
Solutions
- Set params.type to one of 'retinanet', 'mask_rcnn', 'olnmask', or 'shapemask'
- Check the command-line/flag spelling of the model type
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at official/legacy/detection/modeling/factory.py:35 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/d9e6f8a0ff219940.
Report an issue: GitHub.
Appendix: source
Thrown at official/legacy/detection/modeling/factory.py:35
from official.legacy.detection.modeling import maskrcnn_model
from official.legacy.detection.modeling import olnmask_model
from official.legacy.detection.modeling import retinanet_model
from official.legacy.detection.modeling import shapemask_model
def model_generator(params):
"""Model function generator."""
if params.type == 'retinanet':
model_fn = retinanet_model.RetinanetModel(params)
elif params.type == 'mask_rcnn':
model_fn = maskrcnn_model.MaskrcnnModel(params)
elif params.type == 'olnmask':
model_fn = olnmask_model.OlnMaskModel(params)
elif params.type == 'shapemask':
model_fn = shapemask_model.ShapeMaskModel(params)
else:
raise ValueError('Model %s is not supported.'% params.type)
return model_fn
View on GitHub (pinned to e006f5f0d5)