Constant download of resnet34 weights


I’ve just completed lesson 2, and I’ve built a pizza classifier (just two classes, though):

I’m trying to deploy it using Simon Willison’s solution ( expanded with this Heroku deployment tutorial (

I’ve reached the point of building and deploying. However, for some reason, checking the logs it seems that it’s downloading the resnet34 weights on every single request. I don’t understand it, though, as it’s not part of the endpoint implementation. This is causing two issues: 1) causes the app to go on timeout, making it useless. I haven’t managed to effectively use the web app. 2) Takes up memory a lot of memory (I’ve managed to decrease the slug size to 303MB (thanks to this solution: Hosting a simple web application) - this was necessary, considering that the hard limit is 500MB. However, it increases in runtime up to 803MB.

I’d be really glad if anyone could help me out :slight_smile:

Finally, I’m making an attempt with Heroku after trying to use PythonAnywhere (they don’t support Starlette) and ZEIT NOW (there’s a size limit. If I remember correctly, about 50MB. My model weighs around 83MB). I know they offer a paid solution that allows more space, but I was looking for a free (or cheap) solution just to get started.

Thanks in advance,