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/server.py”, line 37, in
learn = loop.run_until_complete(asyncio.gather(*tasks))
File “/usr/local/lib/python3.6/asyncio/base_events.py”, line 484, in run_until_complete
File “app/server.py”, 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/server.py’ returned a non-zero code: 1
ERROR: build step 0 “gcr.io/cloud-builders/docker” failed: exit status 1
could you post the version of fastai that is being installed in the Google App Engine. I think they have changed the signature/name of the function that created CNN learner, which could result in this error.
You can use
from fastai import __version__
to get the version of fastai.
can you log this somewhere and check the value if it is the latest?
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.
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 server.py 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 ?