{"record":{"id":"8afcd2cf14461998","repo":"tensorflow/models","slug":"only-all-backbone-decoder-segmentation-b","errorCode":null,"errorMessage":"Only 'all', 'backbone', 'decoder', 'segmentation_backbone' and/or 'segmentation_decoder' can be used to initialize the model, but got {}","messagePattern":"Only 'all', 'backbone', 'decoder', 'segmentation_backbone' and/or 'segmentation_decoder' can be used to initialize the model, but got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/panoptic/tasks/panoptic_maskrcnn.py","lineNumber":139,"sourceCode":"\n      elif init_module == 'segmentation_backbone':\n        checkpoint_path = _get_checkpoint_path(\n            self.task_config.segmentation_init_checkpoint)\n        ckpt = tf.train.Checkpoint(\n            segmentation_backbone=model.segmentation_backbone)\n        status = ckpt.read(checkpoint_path)\n        status.expect_partial().assert_existing_objects_matched()\n\n      elif init_module == 'segmentation_decoder':\n        checkpoint_path = _get_checkpoint_path(\n            self.task_config.segmentation_init_checkpoint)\n        ckpt = tf.train.Checkpoint(\n            segmentation_decoder=model.segmentation_decoder)\n        status = ckpt.read(checkpoint_path)\n        status.expect_partial().assert_existing_objects_matched()\n\n      else:\n        raise ValueError(\n            \"Only 'all', 'backbone', 'decoder', 'segmentation_backbone' and/or \"\n            \"'segmentation_decoder' can be used to initialize the model, but \"\n            \"got {}\".format(init_module))\n      logging.info('Finished loading pretrained checkpoint from %s for %s',\n                   checkpoint_path, init_module)\n\n  def build_inputs(\n      self,\n      params: exp_cfg.DataConfig,\n      input_context: Optional[tf.distribute.InputContext] = None\n  ) -> tf.data.Dataset:\n    \"\"\"Builds input dataset.\"\"\"\n    decoder_cfg = params.decoder.get()\n    if params.decoder.type == 'simple_decoder':\n      decoder = panoptic_maskrcnn_input.TfExampleDecoder(\n          regenerate_source_id=decoder_cfg.regenerate_source_id,\n          mask_binarize_threshold=decoder_cfg.mask_binarize_threshold,\n          include_panoptic_masks=decoder_cfg.include_panoptic_masks,","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/panoptic/tasks/panoptic_maskrcnn.py#L121-L157","documentation":"Error \"Only 'all', 'backbone', 'decoder', 'segmentation_backbone' and/or 'segmentation_decoder' can be used to initialize the model, but got {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/panoptic/tasks/panoptic_maskrcnn.py:139 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"}