Could you check the shape of your loaded iamges:
imgs = load_LR_HR_imgs_sr(path_to_image , imsize, factor, enforse_div32)
imgs[‘bicubic_np’], imgs[‘sharp_np’], imgs[‘nearest_np’] = get_baselines(imgs[‘LR_pil’], imgs[‘HR_pil’])

Also, which part have you added to the working code to resize the images?