Lesson 1: Not able to run code due to NameError on local Machine

I tried to run lesson1 notebook but I am stuck at NameError: name ‘cv2’ is not defined.

I tried importing cv2 package and executed cv.INTER_AREA which triggered the error above and it gives me a value without an error.

Not sure, why it won’t work while importing fastai.dataset.

Same error occurs when importing fastai.conv_learner and fastai.transforms.

Has anyone stumbled across something similar? How do I resolve this?

If I understand correctly the cv2 package is installed. In that case, try removing it and then re-installing it.

If you are using conda also try to update the packages in the current environment.

Thanks for your input. Yes the cv2 package was installed.

I pulled fastai repo to update my local copy and started fresh and the code works now.

Might be caused due to importing packages I did not need.

1 Like