Skip to content

numpy ValueError from lbfgs._lowlevel #212

@jihyunbak

Description

@jihyunbak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions