Strange error in lesson 1 notebook

I’m running the lesson1 notebook with a new image set, and all goes well up to run-time error in the line marked as 3 below:
TypeError Traceback (most recent call last)
in ()
1 learn.unfreeze()
2 lr=np.array([1e-4,1e-3,1e-2])
----> 3 learn.fit(lr, 3, cycle_len=1, cycle_mult=2)

The most recent call error is at:
–> 445 im, y =fn(im, y)
446 return im if y is None else (im, y)
447

TypeError: ‘list’ object is not callable.

I wondered if anyone had encountered this error and what to do about it please. THanks

1 Like

try this to get some more information
run %debug after this exception
enter ‘fn’ and let’s see what its got.

Hello Brad, thank you for your reply, here is what %debug shows me:

/home/tony/fastai/courses/dl1/fastai/transforms.py(445)compose()
443 for fn in fns:
444 #pdb.set_trace()
–> 445 im, y =fn(im, y)
446 return im if y is None else (im, y)
447

ipdb> fn
[<fastai.transforms.RandomRotate object at 0x7f1dded58518>, <fastai.transforms.RandomLighting object at 0x7f1dded584a8>, <fastai.transforms.RandomDihedral object at 0x7f1dded58550>]

Wow. so that looks like a list of image augmentation functions… which want to be called one at a time, but not called as a list.
you’re in an area of code I haven’t delved - so I’ve no idea how you got there.
My best guess is that somethings not ‘as expected’ in your image set, but just checking you’ve done a git pull recently?
how are your images (and transforms) set up and read into fastai (to get into the learner learn)?

As you say, I had a list of augmentations, I circumvented the problem by pre-processing my images using Augmentor.py (which is a very nifty little app).

that sounds like something fastai would be able to do. might be time to tag Jeremy after explaining the augs/tfms you wanted
(glad you solved it)

I’m facing the same issue. I’m using a dataset with brain scans. When I don’t use any tranforms, I can train the model…

1 Like