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

ValueError related to numpy.dtype size change in spaCy course environment #135

Open
r4plh opened this issue Dec 26, 2024 · 1 comment
Open

Comments

@r4plh
Copy link

r4plh commented Dec 26, 2024

While running the code in the course always getting some ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject , it's coming everytime when the exercise is related to code (not MCQ or any-other)

To see the actual error , just go to any exercise which involve coding , for example one of the way to reproduce the error -

Navigate to the spaCy Advanced NLP course section on "Loading Pipelines." (chapter 1 , 7th section named - Loading Pipeline )
Click on show solution and it will autofill the code correctly , it's not a big issue coz the correct solution is still visible but it would be good if code runs smooth , for better user and learning experience.

Run the correct code.

Full Error :

ValueError Traceback (most recent call last)
Cell In[1], line 28
14 msg = msg
15 solution = blacken("""import spacy
16
17 # Load the "en_core_web_sm" pipeline
(...)
25 # Print the document text
26 print(.)""")
---> 28 import spacy
30 # Load the "en_core_web_sm" pipeline
31 nlp = ____

File /srv/conda/envs/notebook/lib/python3.10/site-packages/spacy/init.py:11
8 setup_default_warnings() # noqa: E402
10 # These are imported as part of the API
---> 11 from thinc.api import prefer_gpu, require_gpu, require_cpu # noqa: F401
12 from thinc.api import Config
14 from . import pipeline # noqa: F401

File /srv/conda/envs/notebook/lib/python3.10/site-packages/thinc/api.py:2
1 from .config import Config, registry, ConfigValidationError
----> 2 from .initializers import normal_init, uniform_init, glorot_uniform_init, zero_init
3 from .initializers import configure_normal_init
4 from .loss import CategoricalCrossentropy, L2Distance, CosineDistance

File /srv/conda/envs/notebook/lib/python3.10/site-packages/thinc/initializers.py:4
1 from typing import Callable, cast
2 import numpy
----> 4 from .backends import Ops
5 from .config import registry
6 from .types import FloatsXd, Shape

File /srv/conda/envs/notebook/lib/python3.10/site-packages/thinc/backends/init.py:8
5 import threading
7 from .ops import Ops
----> 8 from .cupy_ops import CupyOps, has_cupy
9 from .numpy_ops import NumpyOps
10 from ._cupy_allocators import cupy_tensorflow_allocator, cupy_pytorch_allocator

File /srv/conda/envs/notebook/lib/python3.10/site-packages/thinc/backends/cupy_ops.py:19
17 from .. import registry
18 from .ops import Ops
---> 19 from .numpy_ops import NumpyOps
20 from . import _custom_kernels
21 from ..types import DeviceTypes

File /srv/conda/envs/notebook/lib/python3.10/site-packages/thinc/backends/numpy_ops.pyx: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

@r4plh
Copy link
Author

r4plh commented Dec 27, 2024

It's actually coming across all 4 chapters , for chapter 3 and 4 it would be good if this internal compiler of spacy gets fix , coz there are indeed some complex code exercise. @maintainers @ines

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