def predict_large_image(model, input_image):
    """Predict on an image larger than the one it was trained on

    All networks with U-net like architecture in this repo, use downsampling of
    2, which is only conducive for images with shapes in powers of 2. If
    different, please crop / resize accordingly to avoid shape mismatches.

    :param keras.Model model: Model instance
    :param np.array input_image: as named. expected shape:
     [num_channels, (depth,) height, width] or
     [(depth,) height, width, num_channels]
    :return np.array predicted image: as named. Batch axis removed (and channel
     axis if num_channels=1)
    """
    im_size = input_image.shape
    num_dims = len(im_size)
    assert num_dims in [4, 5], \
        'Invalid image shape: only 4D and 5D inputs - 2D / 3D ' \
        'images with channel and batch dim allowed'

    predicted_image = model.predict(input_image)
    return predicted_image