def get_model(project_dir, train_seq, hparams, num_GPUs, logger, args):
    """
    Initializes a tf.keras Model from MultiPlanarUNet.models as specified in
    hparams['build']. If args.continue_training, the best previous model stored
    in [project_dir]/models will be loaded.

    If hparams["build"]["biased_output_layer"] is True, sets the bias weights
    on the final conv. layer so that a zero-input gives an output of class
    probabilities equal to the class frequencies of the training set.

    If num_GPUs > 1, distribute the model on multiple GPUs

    Args:
        project_dir: A path to a MultiPlanarUNet project folder
        train_seq: A MultiPlanarUNet.sequences object for the training data
        hparams: A MultiPlanarUNet YAMLHParams object
        num_GPUs: An integer, the number of GPUs to train the model on
        logger: A MultiPlanarUNet logging object
        args: argparse arguments

    Returns:
        model: The model to fit
        org_model: The original, non-GPU-distributed model
                   (Same as model if num_GPUs==1)
    """
    from MultiPlanarUNet.models import model_initializer
    org_model = model_initializer(hparams=hparams, continue_training=args.
        continue_training, project_dir=project_dir, logger=logger)
    if not args.continue_training and hparams['build'].get(
        'biased_output_layer'):
        from MultiPlanarUNet.utils.utils import set_bias_weights_on_all_outputs
        set_bias_weights_on_all_outputs(org_model, train_seq, hparams, logger)
    if num_GPUs > 1:
        from tensorflow.keras.utils import multi_gpu_model
        model = multi_gpu_model(org_model, gpus=num_GPUs, cpu_merge=False,
            cpu_relocation=False)
        logger('Creating multi-GPU model: N=%i' % num_GPUs)
    else:
        model = org_model
    return model, org_model
