Skip to content

neurolab throws an exception with numpy version 2 #46

@Nadine45832

Description

@Nadine45832

Hi,

I was working on my lab in college and I ran into a problem. I installed numpy latest version (2.1.3) and neurolab latest version (0.3.5) in my environment. When I import both of them, numpy inside neurolab throws an exception:

`np.Inf` was removed in the NumPy 2.0 release. Use `np.inf` instead.

This is a call stack:

Traceback (most recent call last):
  File "NeuralNetworks/nn.py", line 2, in <module>
    import neurolab as nl
  File "NeuralNetworks/venv/lib/python3.12/site-packages/neurolab/__init__.py", line 54, in <module>
    from . import net
  File "NeuralNetworks/venv/lib/python3.12/site-packages/neurolab/net.py", line 38, in <module>
    from . import trans
  File "NeuralNetworks/venv/lib/python3.12/site-packages/neurolab/trans.py", line 51, in <module>
    class PureLin:
  File "NeuralNetworks/venv/lib/python3.12/site-packages/neurolab/trans.py", line 70, in PureLin
    out_minmax = [-np.Inf, np.Inf]

Looks like the fix is simple: update numpy andnp.Inf should be replaced with np.inf.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions