In the docs there is an example to apply transforms.
When I try it with an image that I loaded, I get the error: TypeError: crop_pad() missing 1 required positional argument: 'size'
I had to change the code snippet from:
tfms = get_transforms()
_, axs = plt.subplots(2,4,figsize=(12,6))
for ax in axs.flatten():
img = apply_tfms(tfms[0], get_class_ex(), size=224)
img.show(ax=ax)
To:
tfms = get_transforms()
_, axs = plt.subplots(2,4,figsize=(12,6))
for ax in axs.flatten():
img = apply_tfms(tfms[0], sample_img, xtra={tfms[1][0].tfm: {"size": 224}}, size=224)
img.show(ax=ax)
Is this a problem on my part? Or is the example in the docs wrong?
I had a look at the source code, and it seems like the first transform of the tfms array is a random_crop that calls crop_pad which needs the size parameter.
Which version of fastai are you running? I just ran the notebook without any error.
Maybe try to update your fastai (or use a developer install to have master)?
Hi, I was wondering where you ran the notebook. I’m trying to find it but I can’t, after I run the notebook I will provide the details about the installation and hardware, I’ll see if it’s a problem from my side first.