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

[BUG] -- numpy 2.0.0 raises ValueError in thinc.backends.numpy_ops #939

Open
it176131 opened this issue Jun 17, 2024 · 7 comments
Open

[BUG] -- numpy 2.0.0 raises ValueError in thinc.backends.numpy_ops #939

it176131 opened this issue Jun 17, 2024 · 7 comments
Labels
bug Bugs and behaviour differing from documentation

Comments

@it176131
Copy link

How to reproduce the behaviour

Using Python 3.12.2 on a Windows 10 machine:

$ py -3.12 -m venv env
$ source env/Scripts/activate
$ pip install thinc -U
$ python -c "from thinc.backends.numpy_ops import NumpyOps"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\user\test\env\Lib\site-packages\thinc\backends\__init__.py", line 17, in <module>
    from .cupy_ops import CupyOps
  File "C:\Users\user\test\env\Lib\site-packages\thinc\backends\cupy_ops.py", line 16, in <module>
    from .numpy_ops import NumpyOps
  File "thinc\backends\numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Your Environment

  • Operating System: Windows 10
  • Python Version Used: 3.12.2
  • Thinc Version Used: 9.0.0
  • Environment Information:
Package           Version
----------------- -------
annotated-types   0.7.0
blis              0.7.11
catalogue         2.0.10
colorama          0.4.6
confection        0.1.5
cymem             2.0.8
murmurhash        1.0.10
numpy             2.0.0
packaging         24.1
pip               24.0
preshed           3.0.9
pydantic          2.7.4
pydantic_core     2.18.4
setuptools        70.0.0
srsly             2.4.8
thinc             9.0.0
typing_extensions 4.12.2
wasabi            1.1.3
@it176131 it176131 changed the title numpy 2.0.0 raises ValueError in thinc.backends.numpy_ops numpy 2.0.0 raises ValueError in thinc.backends.numpy_ops Jun 17, 2024
@it176131
Copy link
Author

@it176131 it176131 changed the title numpy 2.0.0 raises ValueError in thinc.backends.numpy_ops [BUG] -- numpy 2.0.0 raises ValueError in thinc.backends.numpy_ops Jun 17, 2024
@koaning
Copy link
Contributor

koaning commented Jun 17, 2024

Figured I'd mention: I also experience this issue on Github Actions in CI running Linux.

https://github.com/koaning/arxiv-frontpage/actions/runs/9544267212/job/26302578156

@it176131
Copy link
Author

Figured I'd mention: I also experience this issue on Github Actions in CI running Linux.

https://github.com/koaning/arxiv-frontpage/actions/runs/9544267212/job/26302578156

That's how I first came across it as well, but on my company's CI so obv couldn't link to it 😅

@honnibal
Copy link
Member

Working on it

@honnibal
Copy link
Member

I've been trying to get wheels built against numpy v2 for cython-blis but I'm having trouble with our wheel-building machinery.

I'm looking at just setting the upper pin for now instead.

@honnibal
Copy link
Member

Just published a new version with the updated pin. This should fix the installation. I'll still work on getting Thinc built against numpy v2 though.

@Manamama
Copy link

Manamama commented Jun 21, 2024

Termux here. FYI, it used to work, see my other report here, now same:

File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/thinc/backends/cupy_ops.py", line 16, in <module>            from .numpy_ops import NumpyOps       ModuleNotFoundError: No module named 'thinc.backends.numpy_ops'                     ~/downloads $

But with the older:

~/downloads $ pip show numpy              Name: numpy                               Version: 1.26.4

(The newest 2.0 numpy installs too but it kvetches as below, only with tts, while the old one does not, so I have to use the older one:)

File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/scipy/sparse/__init__.py", line 295, in <module>             from ._csr import *                     File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/scipy/sparse/_csr.py", line 11, in <module>                  from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks,              ImportError: numpy.core.multiarray failed to import                                 ~/downloads $

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

5 participants