This is the error which is a conflict between torch and streamlit:
2025-01-19 07:06:19.117 Examining the path of torch.classes raised: Tried to instantiate class 'path.path’, but it does not exist! Ensure that it is registered via torch::class
Steps to reproduce:
python 3.10.16
streamlit 1.41.1
torch 2.5.1
The code:
# test1.py
import torch
print(torch.__version__)
print(torch.cuda.is_available())
python test1.py works fine.
The code
# test2.py
import torch
import streamlit as st
print(torch.__version__)
print(torch.cuda.is_available())
st.write("hello")
streamlit run test2.py
gives the error:
2025-01-19 07:06:19.117 Examining the path of torch.classes raised: Tried to instantiate class 'path.path’, but it does not exist! Ensure that it is registered via torch::class
Any view how to fix?