You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run streamlit run project\app.py -- 0, I receive this error:
RuntimeError: Numpy is not available
Traceback:
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 556, in _run_script
exec(code, module.__dict__)
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\project\app.py", line 116, in <module>
page()
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\project\app.py", line 57, in render_run_torch_interface
render_train_interface(TorchTrain, False)
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\train.py", line 84, in render_train_interface
st.write(plot())
^^^^^^
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\train.py", line 79, in plot
fig = plots.plot_out(dataset, contour, size=15, oned=oned)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\plots.py", line 129, in plot_out
scatters = make_scatters(graph, model, size=size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\Desktop\ML\minitorch-workspace\Module-0\.\project\interface\plots.py", line 18, in make_scatters
go.Contour(
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\plotly\graph_objs\_contour.py", line 2895, in __init__
self["z"] = _v
~~~~^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\plotly\basedatatypes.py", line 4804, in __setitem__
self._set_prop(prop, value)
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\plotly\basedatatypes.py", line 5143, in _set_prop
val = validator.validate_coerce(val)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 391, in validate_coerce
v = to_scalar_or_list(v)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in to_scalar_or_list
return [to_scalar_or_list(e) for e in v]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in <listcomp>
return [to_scalar_or_list(e) for e in v]
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in to_scalar_or_list
return [to_scalar_or_list(e) for e in v]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 43, in <listcomp>
return [to_scalar_or_list(e) for e in v]
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\_plotly_utils\basevalidators.py", line 51, in to_scalar_or_list
return to_scalar_or_list(np.array(v))
^^^^^^^^^^^
File "C:\Users\cyunkeat\miniforge3\envs\minitorch\Lib\site-packages\torch\_tensor.py", line 1083, in __array__
return self.numpy()
^^^^^^^^^^^^
I resolved it by downgrading numpy to 1.26.4, as I saw this warning when running streamlit:
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
The text was updated successfully, but these errors were encountered:
After running the following commands (following the the instructions in https://minitorch.github.io/):
I get the following output when I run
pip freeze
in my conda environment:When I run
streamlit run project\app.py -- 0
, I receive this error:I resolved it by downgrading
numpy
to1.26.4
, as I saw this warning when runningstreamlit
:The text was updated successfully, but these errors were encountered: