raiseValueError("The size of the image is too small compared to the depth of the UNet. Choose a different 'resize' and/or a smaller model.")
elifh_adjust!=im_heightorw_adjust!=im_width:
log.warning(f"The image size doesn't match the Unet model's depth. The image is changed with '{resize}', from {im_height,im_width} to {h_adjust,w_adjust}.")
# Finding suitable size to downsize with crop / resize
else:
final_d=(orig_d//2**n_channels)*2**n_channels
final_h=(orig_h//2**n_channels)*2**n_channels
final_w=(orig_w//2**n_channels)*2**n_channels
# Check if the image size is too small compared to the model's depth
iffinal_d==0orfinal_h==0orfinal_w==0:
msg="The size of the image is too small compared to the depth of the UNet. \
Choose a different 'resize' and/or a smaller model."