code: def main(ckpt_path: str, model_name: str, model: tf.keras.Model):
      var_dict = {v.name.split(":")[0]: v for v in model.weights}
  
      reader = tf.train.load_checkpoint(ckpt_path)
      var_shape_map = reader.get_variable_to_shape_map()
  
      for key, var in var_dict.items():
          key_ = model_name + "/" + key
          key_ = key_.replace(
              "batch_normalization", "tpu_batch_normalization"
          )
          if key_ in var_shape_map:
              if var_shape_map[key_] != var.shape:
                  msg = "shape mismatch: {}".format(key)
                  print(msg)
              else:
                  var.assign(reader.get_tensor(key_), read_value=False)
          else:
              msg = "Not found {} in {}".format(key, ckpt_path)
              print(msg)
  
      model.save_weights("./{}.h5".format(model_name))
  
label_desc: Use image node_id 1 for calling a global function with example usage: main(ckpt_path, model_name, model) without return types