Log_args not defined

I am getting below error while trying the execute very first code example in Google Colab from the course , can some one help ?

Code :
from fastai2.vision.all import *
path = untar_data(URLs.PETS)/‘images’

def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
path, get_image_files(path), valid_pct=0.2, seed=42,
label_func=is_cat, item_tfms=Resize(224))

learn = cnn_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)

Error :
NameError Traceback (most recent call last)

in () ----> 1 from fastai2.vision.all import * 2 path = untar_data(URLs.PETS)/‘images’ 3 4 def is_cat(x): return x[0].isupper() 5 dls = ImageDataLoaders.from_name_func(

4 frames

/usr/local/lib/python3.7/dist-packages/fastai2/layers.py in () 274 275 # Cell → 276 @log_args 277 class BaseLoss(): 278 “Same as loss_cls, but flattens input and target.”

NameError: name ‘log_args’ is not defined

Isn’t fastai2 just fastai now? Are these the old notebooks maybe?

Please update the fastcore library. And fastai2 should be renamed to fastai in the import section.
!pip install -U fastcore

from fastai.vision.all import *
1 Like

Updating to recent fast version resolved issue .

pip install fastai --upgrade