Hello
I am trying to deploy my flask web app, the app has a model i built in lesson 2 using ofc fastai.
the first problem I ran into is heroko free account only allow slugs up to 500mb, and fastai use the pytorch library which originally have more than 500mb, so the trick I found is to force fastai by only download the cpu version of pytorch which is 150mb i guess ( i saw lot of people doing that, and it worked for them)
here’s my requirement.txt after I updated it:
but again i ran into another problem in heroku when I couldn’t find an answer for is this:
I had the similar issue but for torch 1.6.0 with torchvision 0.7.0. What worked is changing the python version it was using by default.
Error on heroku website was:
AttributeError: Can't get attribute 'CrossEntropyLossFlat' on <module 'fastai.layers' from '/app/.heroku/python/lib/python3.6/site-packages/fastai/layers.py'>
After adding a runtime.txt with python-3.8.5, it finally got deployed. However, although it works, I am getting a warning now:
/app/.heroku/python/lib/python3.8/site-packages/fastcore/foundation.py:56: UserWarning: `patch_property` is deprecated and will be removed; use `patch(as_prop=True)` instead warnings.warn("`patch_property` is deprecated and will be removed; use `patch(as_prop=True)` instead")