Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with "RuntimeError: Numpy is not available" #4

Open
JaegerCQ opened this issue Dec 2, 2024 · 2 comments
Open

problem with "RuntimeError: Numpy is not available" #4

JaegerCQ opened this issue Dec 2, 2024 · 2 comments

Comments

@JaegerCQ
Copy link

JaegerCQ commented Dec 2, 2024

Amazing work! But i couldn't figure out why i met the problem "RuntimeError: Numpy is not available" after using "streamlit run DeepSNUPI.py ". (i have checked that the package numpy is already installed in the enviroment DeepSNUPI). Could u plz help me with the problem? thanks a lot!!!

the complete error is shown below:

RuntimeError: Numpy is not available

File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script exec(code, module.dict )
File "C:\Users\ls\Desktop\DeepSNUPI\DeepSNUPI.py", line 160, in fig_init = draw_DnaOrigami(dna, dna.x[:,0:6], SE_init, EE_init)
File "C:\Users\ls\Desktop\DeepSNUPI\src\visual.py", line 59, in draw_DnaOrigami trace_edges = go.Scatter3d( x=x_edges,
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages\plotly\graph_objs_scatter3d.py", line 2758, in init self["x"] = _v
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages\plotly\basedatatypes.py", line 4873, in setitem self._set_prop(prop, value)
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages\plotly\basedatatypes.py", line 5212, in _set_prop val = validator.validate_coerce(val)
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages_plotly_utils\basevalidators.py", line 401, in validate_coerce v = to_scalar_or_list(v)
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages_plotly_utils\basevalidators.py", line 41, in to_scalar_or_list return [to_scalar_or_list(e) for e in v]
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages_plotly_utils\basevalidators.py", line 41, in return [to_scalar_or_list(e) for e in v]
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages_plotly_utils\basevalidators.py", line 49, in to_scalar_or_list return to_scalar_or_list(np.array(v))
File "C:\Users\ls\anaconda3\envs\DeepSNUPI\lib\site-packages\torch_tensor.py", line 970, in array return self.numpy()

@SSDL-SNU
Copy link
Owner

SSDL-SNU commented Dec 5, 2024

Issue: RuntimeError: Numpy is not available

Thank you for the kind words and for using DeepSNUPI! I appreciate you bringing up this issue, and I’d be happy to help. It seems the error occurs because the program is trying to convert a torch.Tensor to a numpy array in the draw_DnaOrigami function.

Please ensure Compatibility of Dependencies

Conflicts between torch, numpy, and plotly can sometimes cause issues. Update them to compatible versions:
For reference, here are the current dependency versions in my conda environment:

  • pytorch: 2.0.0
  • numpy: 1.26.4
  • plotly: 5.15.0

To ensure compatibility, you can update them to their latest versions:
pip install --upgrade numpy torch plotly

Thank you again and best wishes!

@JaegerCQ
Copy link
Author

JaegerCQ commented Dec 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants