Regular reboot required

Hi!

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

@Marisa_Smith

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!
Marisa

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:
torch==1.7.0
to:
--find-links https://download.pytorch.org/whl/torch_stable.html torch==1.7.0+cpu

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

1 Like