Issue dogs_cats in /examples for fastai v1

Hey there, I am trying to learn how the new fastai v1 lib works & was working through the dogs_cats notebook in the examples folder. I came across an error:

NameError                                 Traceback (most recent call last)
<ipython-input-5-034dbdf84b1c> in <module>()
----> 1 data = ImageDataBunch.from_folder(path, ds_tfms=get_transforms(), tfms=imagenet_norm, size=224)
      2 img,label = data.valid_ds[-1]

NameError: name 'imagenet_norm' is not defined

Seems this was transformation was removed a little while ago. What do you suggest instead? I am wary to remove it since I recall during a video lesson that there was some normalization that needed to be done with imagenet data to make it work with new images as it performs transfer learning.

fastai.__version__ = '1.0.19.dev0'

1 Like

The normalization is now done with data.normalize(imagenet_stats).

I get: TypeError: normalize() missing 2 required positional arguments: ‘mean’ and ‘std’

What are the versions of Pytorch and Pillow?

The following worked for me: