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

numpy ValueError from lbfgs._lowlevel #212

Open
jihyunbak opened this issue Aug 10, 2022 · 0 comments
Open

numpy ValueError from lbfgs._lowlevel #212

jihyunbak opened this issue Aug 10, 2022 · 0 comments

Comments

@jihyunbak
Copy link
Member

I get this error when trying to import pyuoi (installed through pip, v1.1.1) from python 3.8 (3.8.12) and numpy 1.21.2:

>>> from pyuoi.linear_model import UoI_Lasso
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jhbak/opt/anaconda3/envs/cotula/lib/python3.8/site-packages/pyuoi/__init__.py", line 1, in <module>
    from .linear_model import UoI_Lasso
  File "/home/jhbak/opt/anaconda3/envs/cotula/lib/python3.8/site-packages/pyuoi/linear_model/__init__.py", line 10, in <module>
    from .logistic import MaskedCoefLogisticRegression, UoI_L1Logistic
  File "/home/jhbak/opt/anaconda3/envs/cotula/lib/python3.8/site-packages/pyuoi/linear_model/logistic.py", line 21, in <module>
    from ..lbfgs import fmin_lbfgs, AllZeroLBFGSError
  File "/home/jhbak/opt/anaconda3/envs/cotula/lib/python3.8/site-packages/pyuoi/lbfgs/__init__.py", line 8, in <module>
    from ._lowlevel import LBFGS, AllZeroLBFGSError  # noqa: F401
  File "pyuoi/lbfgs/_lowlevel.pyx", line 1, in init pyuoi.lbfgs._lowlevel
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

I got the same (I think..) error when I tried combinations of these different versions in python 3.8:

  • numpy 1.20.3
  • pyuoi editable install using the latest commit (as of Aug 9)

The solution that finally worked for me was:

  • python 3.7 (3.7.13) --- looks like this was the key
  • numpy 1.20.3
  • pyuoi install from the latest commit.
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

1 participant