Fastai v1 - Google Colab DataBunch TypeError

Hi,

I am trying to use fastai v1 and Colab.
When trying the following on my local machine, I have no problem creating the DataBunch and training a model:

tfms = [rand_resize_crop(size = 256), rand_resize_crop(size = 256)]
bunch = DataBunch.create(dataset_train,dataset_valid, ds_tfms=tfms, mode = 'bilinear',padding_mode = 'zeros', bs=1, num_workers=0)

However, when trying the same thing on Colab, I get the following error.

TypeError Traceback (most recent call last) <ipython-input-74-5e892b3d58ee> in <module>() ----> [1](https://localhost:8080/#) bunch = DataBunch.create(dataset_train,dataset_valid, ds_tfms=tfms, mode = 'bilinear',padding_mode = 'zeros', bs=1, num_workers=0)

TypeError: create() got an unexpected keyword argument 'ds_tfms'

But I have the same versions of torch-nightly (1.0.0.dev20181019), torch vision (0.2.1) and fastai (1.0.11) on both Colab and my machine …

Do you have any idea why I am running into this error on Colab?

Thank you very much !

There was a change in the API, which is why you see inconsistent behavior: you have an old version of the library on your local machine and a more recent one on Colab.
You want an ImageDataBunch for vision now, which will take those arguments. DataBunch is just the generic class so it doesn’t have ds_tfms as an argument.

Thank you !
However, when using ImageDataBunch, it now seems that the mode I am passing mode = 'bilinear' is not passed in pytorch nn.functional. When fitting the model, I get the following error :
NotImplementedError: nn.functional.grid_sample got unsupported mode: 'nearest'
I couldn’t find where to specify the mode else than when creating the ImageDataBunch…

Note that if you have this error, it’s because you are using pytorch 0.4, so expect other things to break.
I’ll see why this mode isn’t properly passed to the transforms.