Getting error while deploying lesson 2 bear classification to google app engine


I am trying to deploy Jeremy’s bear classification model from Lesson 2 into production in Google App Engine . I am following the steps in the page below :

I am getting the error below at the end. If someone can tell me what i am doing wrong leading to the error below :
Traceback (most recent call last):
File “app/”, line 37, in
learn = loop.run_until_complete(asyncio.gather(*tasks))[0]
File “/usr/local/lib/python3.6/asyncio/”, line 484, in run_until_complete
return future.result()
File “app/”, line 31, in setup_learner
learn = create_cnn(data_bunch, models.resnet34, pretrained=False)
NameError: name ‘create_cnn’ is not defined
The command ‘/bin/sh -c python app/’ returned a non-zero code: 1
ERROR: build step 0 “” failed: exit status 1

Kaushik Saha

Plus you, now 3 persons are having the same error on “NameError: name ‘create_cnn’ is not defined”…

How do we highlight this problem to fastai team…?

Hi @coolkaushik22, @Vishesh1042, @SiewLin

If you get the version from above and it says
1.0.47-post1, you can fix the name error by replacing create_cnn method
with cnn_learner with all the same parameters. The fastai team
has deprecated the method create_cnn with cnn_learner but haven’t
gotten around to updating the docs.
I’ve already sent a message to the fastai devs here regarding the breaking change. I hope they respond.

Best regards,

1 Like


Thanks for the input and help here!
I couldnt check the version of fastain in GCP as I am not sure how to do that (please let me know how) , but i changed the create_cnn to cnn_learner in code downloaded from fastai git.

With this change my code ran in GCP, but when i opened the app link and uploaded a bear picture for scoring, the page was stuck at ‘analysing’ without any result.
Kindly let me know what i should do at this step to fix this ?

Kaushik Saha

You should be able to check what version of you have with the code @Vishesh1042 provided

from fastai import __version__