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

library with this error #253

Open
Ickwarw opened this issue Jun 20, 2022 · 1 comment
Open

library with this error #253

Ickwarw opened this issue Jun 20, 2022 · 1 comment

Comments

@Ickwarw
Copy link

Ickwarw commented Jun 20, 2022

this error is being presented when I use this pybrain library

this is my code:
from pybrain.structure import FeedForwardNetwork
from pybrain.structure import LinearLayer, SigmoidLayer, BiasUnit
from pybrain.structure import FullConnection

rneural = FeedForwardNetwork()

CE = LinearLayer(4)
CO = SigmoidLayer(6)
CS = SigmoidLayer(1)
b1 = BiasUnit()
b2 = BiasUnit()

rneural.addModule(CE)
rneural.addModule(CO)
rneural.addModule(CS)
rneural.addModule(b1)
rneural.addModule(b2)

EO = FullConnection(CE, CO)
OS = FullConnection(CO, CS)
bO = FullConnection(b1, CO)
bS = FullConnection(b2, CS)

rneural.sortModule()
print(rneural)

when I run:

python3 rneural.py
Traceback (most recent call last):
File "/home/warwick/Desktop/scriptsinpython/ai/rneural.py", line 1, in
from pybrain.structure import FeedForwardNetwork
File "/home/warwick/environments/my_env/lib/python3.10/site-packages/pybrain/init.py", line 1, in
from pybrain.structure.init import *
File "/home/warwick/environments/my_env/lib/python3.10/site-packages/pybrain/structure/init.py", line 2, in
from pybrain.structure.modules.init import *
File "/home/warwick/environments/my_env/lib/python3.10/site-packages/pybrain/structure/modules/init.py", line 2, in
from pybrain.structure.modules.gate import GateLayer, DoubleGateLayer, MultiplicationLayer, SwitchLayer
File "/home/warwick/environments/my_env/lib/python3.10/site-packages/pybrain/structure/modules/gate.py", line 10, in
from pybrain.tools.functions import sigmoid, sigmoidPrime
File "/home/warwick/environments/my_env/lib/python3.10/site-packages/pybrain/tools/functions.py", line 4, in
from scipy.linalg import inv, det, svd, logm, expm2
ImportError: cannot import name 'expm2' from 'scipy.linalg' (/home/warwick/environments/my_env/lib/python3.10/site-packages/scipy/linalg/init.py)

I've tried several solutions but the only one I haven't tried is to downgrade python3.10, I think it's not the most correct solution if anyone knows how to fix this

thanks

@sheikhartin
Copy link

sheikhartin commented Jun 30, 2022

Welcome to a legacy project! The current version of SciPy as of this writing is 1.8.1‍ and expm2 matrix exponential function is deprecated in 0.13.0. (This also happened for expm3)

The official SciPy documentation on release 0.13.0:
https://docs.scipy.org/doc/scipy/release.0.13.0.html?highlight=expm2#deprecated-features

You should try to install an older version of Python and of course packages. As suggested Python 2.5 based on this line of code in setup.py in the root directory.

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