code: def migrate_model_params(model: dict):
      convert_layer_name = {
          "convolutional": "calamari_ocr.ocr.model.layers.conv2d:Conv2DLayerParams",
          "concat": "calamari_ocr.ocr.model.layers.concat:ConcatLayerParams",
          "max_pooling": "calamari_ocr.ocr.model.layers.pool2d:MaxPool2DLayerParams",
          "lstm": "calamari_ocr.ocr.model.layers.bilstm:BiLSTMLayerParams",
          "transposed_conv": "calamari_ocr.ocr.model.layers.transposedconv2d:TransposedConv2DLayerParams",
          "dilated_block": "calamari_ocr.ocr.model.layers.dilatedblock:DilatedBlockLayerParams",
          "dropout": "calamari_ocr.ocr.model.layers.dropout:DropoutLayerParams",
      }
      for layer in model["layers"]:
          del layer["lstm_direction"]
          if layer["type"] != "lstm":
              del layer["peepholes"]
              del layer["hidden_nodes"]
          if layer["type"] != "dilated_block":
              del layer["dilated_depth"]
          if layer["type"] != "concat":
              del layer["concat_indices"]
          if layer["type"] not in {
              "convolutional",
              "max_pooling",
              "dilated_block",
              "transposed_conv",
          }:
              del layer["stride"]
              del layer["filters"]
              del layer["kernel_size"]
          if layer["type"] == "max_pooling":
              del layer["filters"]
              rename(layer, "kernel_size", "pool_size")
  
          layer["__cls__"] = convert_layer_name[layer["type"]]
          del layer["type"]
  
      model["layers"].append(
          {
              "__cls__": convert_layer_name["dropout"],
              "rate": model["dropout"],
          }
      )
      del model["dropout"]
  
file_path: calamari/calamari_ocr/ocr/savedmodel/migrations/version3_4to5.py
imports: import logging
  import os
  from tensorflow import keras
  from tfaip.util.tfaipargparse import post_init
  from calamari_ocr.ocr.scenario import CalamariScenario
  from calamari_ocr.ocr.training.params import TrainerParams
label_desc: Use image node_id 3 for calling a global function with example usage: migrate_model_params(model) without return types