ModuleNotFoundError for torch

Here is the app: https://melanomas.streamlit.app/
I have commented out the torch import and have as such decoupled my ML model from the app because I prefer having it up rather than displaying an error message and nonfunctional.

Here is my repository: GitHub - FFFiend/melanoma_classification: Interactive melanoma classifier based on a CNN model I wrote, hosted using Streamlit.
You can see that I have a requirements.txt file with the specific torch version included, yet the app refuses to work, along with a config.toml file with torch specified.

I left both the .toml and .txt files in for reference to debug, however yes I have independently tried both solutions and none seem to work.

I don’t think an error message is necessary since I’ve described everything in sufficient detail.

Streamlit version: 1.29.0, Python version: 3.9.6 and I’m using torch 2.1.2.

Any help would be greatly appreciated.

Thank you.

  • remove the toml file
  • try this below :arrow_down:
  • do a reboot of the app

requirements.txt

numpy
pillow
streamlit
torch==2.1.2
1 Like

That fixed it, tysm.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.