Deploying in Heroku error "not a supported wheel on this platform"

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:
image

but again i ran into another problem in heroku when I couldn’t find an answer for is this:

   "ERROR: torch-1.1.0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform."

can you please suggest any solutions to the problem?

https://raw.githubusercontent.com/joedockrill/heroku/master/requirements.txt

Those work.

1 Like

You could copy these requirements from here:

These work.

Thanks it worked

1 Like

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")

Removed the --debug option and all is good after that. :slight_smile:
App: https://obama-classifier.herokuapp.com/

I’m getting errors for each version from list of torch stable versions. like

`… not a supported wheel on this platform

Try to put this into your requirements.txt(it’s image)

// requirements.txt

-f https://download.pytorch.org/whl/torch_stable.html
torch==1.8.1+cpu 
torchvision==0.9.1+cpu
fastai>=2.3.1
ipywidgets
voila
6 Likes

Thanks! Worked for me