tensorflow/models · error · ValueError
Unsupported model version please select from
Error message
Unsupported model version please select from {v3, v4}, or specify a custom decoder config using YoloDecoder in you yaml What it means
Membership check in build_yolo_decoder: decoder_cfg.version is set but not present in the YOLO_MODELS registry, so no decoder topology exists for it. Beyond plain typos ('V4', 'v5'), this fires when the installed modeling code does not support the requested version — the valid set is whatever keys YOLO_MODELS currently defines (v3, v4).
Solutions
- Use 'v3' or 'v4' (exact lowercase) as decoder.version
- Check the keys of YOLO_MODELS in yolo_model.py for the versions supported by your build
- For unsupported versions, provide a custom YoloDecoder config in the yaml as the message suggests
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at official/projects/yolo/modeling/decoders/yolo_decoder.py:604 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/845dbfa607767925.
Report an issue: GitHub.
Appendix: source
Thrown at official/projects/yolo/modeling/decoders/yolo_decoder.py:604
l2_regularizer: A `tf_keras.regularizers.Regularizer` instance. Default to
None.
**kwargs: Additional kwargs arguments.
Returns:
A `tf_keras.Model` instance of the Yolo FPN/PAN decoder.
"""
decoder_cfg = model_config.decoder.get()
norm_activation_config = model_config.norm_activation
activation = (
decoder_cfg.activation if decoder_cfg.activation != 'same' else
norm_activation_config.activation)
if decoder_cfg.version is None: # custom yolo
raise ValueError('Decoder version cannot be None, specify v3 or v4.')
if decoder_cfg.version not in YOLO_MODELS:
raise ValueError(
'Unsupported model version please select from {v3, v4}, '
'or specify a custom decoder config using YoloDecoder in you yaml')
if decoder_cfg.type is None:
decoder_cfg.type = 'regular'
if decoder_cfg.type not in YOLO_MODELS[decoder_cfg.version]:
raise ValueError('Unsupported model type please select from '
'{yolo_model.YOLO_MODELS[decoder_cfg.version].keys()}'
'or specify a custom decoder config using YoloDecoder.')
base_model = YOLO_MODELS[decoder_cfg.version][decoder_cfg.type].copy()
cfg_dict = decoder_cfg.as_dict()
for key in base_model:
if cfg_dict[key] is not None:
base_model[key] = cfg_dict[key]
View on GitHub (pinned to e006f5f0d5)