Error of "name 'vision_learner' is not defined"

Hi friends,
I am getting the error like this in chapter 4.


thank you for help.

You need to upgrade your fastai version :smile:

2 Likes

you can write ‘cnn_learner’ insted. vision_learner used in the upgradet version

thank you for reply. it works now

thank you. I changed nothing, just rerun it and it works now.

For those that were confused like me, this is not a git-pull upgrade… but a terminal upgrade:

pip3 install --upgrade fastai

1 Like

Hello. I have the same issue. Upgrading fastai does not solve it.

Try changing vision_learner with cnn_lerner

1 Like

I’m also getting this issue in my notebook on Kaggle. Switching to “cnn_learner” fixes the problem.

I found that if the accelerator is TPU on Kaggle, it will result in such error. However, I don’t know why.

I want to know why vision_learner is not defined. If I tried to import it using
from fastai.vision.all import vision_learner
using
learn = vison_learner(dls, resnet34, metrics=error_rate)
it does not give error but when I try to train the model, it starts to show errors

You have a typo.
You typed vison_learner instead of vision_learner :slight_smile:

1 Like