{"record":{"id":"fdbbccb03ebb2c61","repo":"tensorflow/models","slug":"decoder-version-cannot-be-none-specify-v3-or-v4","errorCode":null,"errorMessage":"Decoder version cannot be None, specify v3 or v4.","messagePattern":"Decoder version cannot be None, specify v3 or v4\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/yolo/modeling/decoders/yolo_decoder.py","lineNumber":601,"sourceCode":"    input_specs: A `dict` of input specifications. A dictionary consists of\n      {level: TensorShape} from a backbone.\n    model_config: A OneOfConfig. Model config.\n    l2_regularizer: A `tf_keras.regularizers.Regularizer` instance. Default to\n      None.\n    **kwargs: Additional kwargs arguments.\n\n  Returns:\n    A `tf_keras.Model` instance of the Yolo FPN/PAN decoder.\n  \"\"\"\n  decoder_cfg = model_config.decoder.get()\n  norm_activation_config = model_config.norm_activation\n\n  activation = (\n      decoder_cfg.activation if decoder_cfg.activation != 'same' else\n      norm_activation_config.activation)\n\n  if decoder_cfg.version is None:  # custom yolo\n    raise ValueError('Decoder version cannot be None, specify v3 or v4.')\n\n  if decoder_cfg.version not in YOLO_MODELS:\n    raise ValueError(\n        'Unsupported model version please select from {v3, v4}, '\n        'or specify a custom decoder config using YoloDecoder in you yaml')\n\n  if decoder_cfg.type is None:\n    decoder_cfg.type = 'regular'\n\n  if decoder_cfg.type not in YOLO_MODELS[decoder_cfg.version]:\n    raise ValueError('Unsupported model type please select from '\n                     '{yolo_model.YOLO_MODELS[decoder_cfg.version].keys()}'\n                     'or specify a custom decoder config using YoloDecoder.')\n\n  base_model = YOLO_MODELS[decoder_cfg.version][decoder_cfg.type].copy()\n\n  cfg_dict = decoder_cfg.as_dict()\n  for key in base_model:","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/yolo/modeling/decoders/yolo_decoder.py#L583-L619","documentation":"Error \"Decoder version cannot be None, specify v3 or v4.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/yolo/modeling/decoders/yolo_decoder.py:601 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}