Failed to deploy the model on Heroku

Hi everyone! I am trying to build a classification model as in Chapter 2 and deploy it with Heroku. The model works fine with voila but failed to output/load the inference on Heroku. The model seems to be failed when it calls the line:

pred,_,probs = learn_inf.predict(img)

Does anyone have an idea why this happens and how to fix it?

Here are some information about my model:

Procfile
web: voila --port=$PORT --no-browser --enable_nbextensions=True a_horse_or_a_deer.ipynb

requirements
https://download.pytorch.org/whl/cpu/torch-1.6.0%2Bcpu-cp38-cp38-linux_x86_64.whl
https://download.pytorch.org/whl/cpu/torchvision-0.7.0%2Bcpu-cp38-cp38-linux_x86_64.whl
fastai
ipywidgets
voila

Main file:

Application Log on Heroku

Is there some sort of error message you got? I don’t see anything that stands out as being an error in the Heroku log you have attached…

There is no error message at all and that is the reason I am confused. The function ran until “test 1” is printed and stopped there. So I guess there is a problem with running the ‘predict’ method because I can call the result of ‘learn_inf.dls.vocab’.

Here is the result from voila:

Here is the result from Heroku: