{"record":{"id":"24c8024bbb4f83fe","repo":"tensorflow/models","slug":"unsupported-checkpoint-format-checkpoint-format","errorCode":null,"errorMessage":"Unsupported checkpoint format {checkpoint_format}.","messagePattern":"Unsupported checkpoint format (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/modeling/common_modules.py","lineNumber":126,"sourceCode":"  \"\"\"Load model weights from the given file path.\n\n  Args:\n    model: the model to load weights into\n    model_weights_path: the path of the model weights\n    checkpoint_format: The source of checkpoint files. By default, we assume the\n      checkpoint is saved by tf.train.Checkpoint().save(). For legacy reasons,\n      we can also resotre checkpoint from keras model.save_weights() method by\n      setting checkpoint_format = 'keras_checkpoint'.\n  \"\"\"\n  if checkpoint_format == 'tf_checkpoint':\n    checkpoint_dict = {'model': model}\n    checkpoint = tf.train.Checkpoint(**checkpoint_dict)\n    checkpoint.restore(model_weights_path).assert_existing_objects_matched()\n  elif checkpoint_format == 'keras_checkpoint':\n    # Assert makes sure load is successeful.\n    model.load_weights(model_weights_path).assert_existing_objects_matched()\n  else:\n    raise ValueError(f'Unsupported checkpoint format {checkpoint_format}.')\n\n\ndef normalize_images(\n    features: tf.Tensor,\n    num_channels: int = 3,\n    dtype: str = 'float32',\n    data_format: str = 'channels_last',\n    mean_rgb: Tuple[float, ...] = MEAN_RGB,\n    stddev_rgb: Tuple[float, ...] = STDDEV_RGB,\n) -> tf.Tensor:\n  \"\"\"Normalizes the input image channels with the given mean and stddev.\n\n  Args:\n    features: `Tensor` representing decoded images in float format.\n    num_channels: the number of channels in the input image tensor.\n    dtype: the dtype to convert the images to. Set to `None` to skip conversion.\n    data_format: the format of the input image tensor ['channels_first',\n      'channels_last'].","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/modeling/common_modules.py#L108-L144","documentation":"Error \"Unsupported checkpoint format {checkpoint_format}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/modeling/common_modules.py:126 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"}