def set_mrcnn_head_weights(training_model, inference_model, verbose=False):
    """
    Set MaskRCNN head weights from training to inference graph
    Args:
        training_model:   MaskRCNN training graph,  tf.keras.Model
        inference_model:  MaskRCNN inference graph, tf.keras.Model
        verbose:          Print layers that get weights, bool

    Returns: inference_model

    """
    mrcnn_head_layers = ['mrcnn_mask_conv1', 'mrcnn_mask_bn1',
                         'mrcnn_mask_conv2', 'mrcnn_mask_bn2',
                         'mrcnn_mask_conv3', 'mrcnn_mask_bn3',
                         'mrcnn_mask_conv4', 'mrcnn_mask_bn4',

                         'mrcnn_class_conv1', 'mrcnn_class_bn1',
                         'mrcnn_class_conv2', 'mrcnn_class_bn2',

                         'fpnclf_mrcnn_class_logits', 'fpnclf_mrcnn_bbox_fc',

                         'mrcnn_mask_deconv', 'mrcnn_mask',
                         ]

    for layer_name in mrcnn_head_layers:

        # Get weights from training graph
        layer_weights = training_model.get_layer(layer_name).get_weights()
        # Set weights in inference graph
        inference_model.get_layer(layer_name).set_weights(layer_weights)

        if verbose:
            print(f'Set weights: {layer_name}')

    return inference_model