Regular reboot required


My app works fine locally and also when I deploy it :slight_smile:

At first anyways. I can never get it to crash myself, but every now and then (like after a week or two) the app suddenly displays an error suggesting my packages aren’t installed properly.

ModuleNotFoundError: No module named ‘torch’

But torch is listed in my requirements.txt file.

Fixing the issue is easy: I just need to reboot the app! :grinning:

But why does this happen? How can I prevent the need for regular manual reboots?

Github link


1 Like

Hey @femkebg,

I have sent this on internally to check, but I have a seeking suspicion that your app is going over usage limits (800 mb is given to all apps on the Sharing platform). This is causing it to crash, we have had a number of other similar problems with Torch (its very big). Checkout this link to a similar issue:

I will let you know more when I hear back from the team!

Hi @Marisa_Smith,

Thanks for looking into it!

I’ve installed the CPU version for torch and for now it works. Not sure if the issue is fixed though.

Looking forward from hearing back from you/internal :smiley:

1 Like

Hey @femkebg,

That’s great to hear! Can you post the code or line from your requirements.txt file that installs this CPU version for Torch?

I will mark that as the solution!

I will still get back to you when I hear from the engineering team (they are super busy- lots of exciting things happening over here! :sunglasses:)

Happy Streamlit-ing!

Hi @Marisa_Smith,

Thanks again :slight_smile:

I’m not sure it is the solution though - time will tell. It hasn’t crashed so far, but it has always taken a week or more before the crash occurred.

Like in the post you referred to I replaced torch with the cpu version.

So in requirements.txt from:
--find-links torch==1.7.0+cpu

But that has an additional dependency, which resulted in an import error, which can be resolved by adding:
to the packages.txt file

1 Like