I got stuck trying to use label_empty(): label_empty() got an unexpected keyword argument ‘label_cls’
After looking more closely at the inference tutorial (https://docs.fast.ai/tutorial.inference.html) I now see that the new way to do this is to use Learner.export() and then load_learner().
Well you can’t apply data augmentation to your images at inference in a segmentation task: you may lose some pixels of your original image and you won’t have predictions for them. I don’t know what where the validation transforms you passed, but there shouldn’t be any.
If I set tfm_y=False it works, but I think this turns off training label transforms too which I shouldn’t do.
I’m thinking maybe the only transformation on the validation set is resizing, but that could be what’s causing the issue?
Edit: Ah okay, I didn’t realize that get_transforms() by default is cropping the validation set and then that transformation is applied when trying to add a test set. I think I can just do this after training then:
# add test data
learn.data.valid_ds.tfms = []
learn.data.valid_ds.tfms_y = []
test_imgs = path/'test'
test_data = SegmentationItemList.from_folder(test_imgs)
learn.data.add_test(test_data)