锐单电子商城 , 一站式电子元器件采购平台!
  • 电话:400-990-0325

ValueError: numpy.ndarray size changed, may indicate binary incompatibility

时间:2022-11-23 21:00:01 hps拉绳位稳传感器

I am trying to getnumpy<1.19.0andConfigSpace==0.4.16to work in apython==3.7conda environment. The installed version ofnumpyis1.18.5.

I am getting the following error:

Traceback (most recent call last):   File "/home/user/.conda/envs/deephyper/bin/deephyper", line 5, in      from deephyper.core.cli import main   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/core/cli/__init__.py", line 1, in      from deephyper.core.cli.cli import main   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/core/cli/cli.py", line 9, in      from deephyper.core.cli import hps, nas, balsam_submit   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/core/cli/hps.py", line 6, in      from deephyper.search.util import load_attr_from   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/search/__init__.py", line 6, in      from deephyper.search.search import Search   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/search/search.py", line 8, in      from deephyper.evaluator.evaluate import Evaluator   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/evaluator/__init__.py", line 5, in      from deephyper.evaluator.evaluate import Encoder   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/evaluator/evaluate.py", line 15, in      import skopt   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/__init__.py", line 45, in      from . import callbacks   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/callbacks.py", line 17, in      from skopt.utils import dump   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/utils.py", line 19, in      from .sampler import Sobol, Lhs, Hammersly, Halton, Grid   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/sampler/__init__.py", line 4, in      from .lhs import Lhs   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/sampler/lhs.py", line 9, in      from ..space import Space, Categorical   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/space/__init__.py", line 5, in      from .space import *   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/space/space.py", line 27, in      import ConfigSpace as CS   File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/ConfigSpace/__init__.py", line 37, in      from ConfigSpace.configuration_space import Configuration, \   File "ConfigSpace/configuration_space.pyx", line 39, in init ConfigSpace.configuration_space   File "ConfigSpace/hyperparameters.pyx", line 1, in init ConfigSpace.hyperparameters ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject 

I tried suggested solutions suggested in other similar questions such as trying other versions ofnumpyor removing allnumpyinstallations and reinstallingnumpyandConfigSpacewithpipoptions--no-cache-dir --no-binary, but the error persists.

Are there other potential solutions that I could try?

pythonpython-3.xpipruntime-errorcompatibility

Share

Follow

editedJan 31, 2021 at 1:08

askedJan 31, 2021 at 0:51

Jake

15322 silver badges99 bronze badges

Add a comment

3 Answers

Sorted by:

Trending sort available

Highest score (default) Trending (recent votes count more) &nbp;               Date modified (newest first)                                                                   Date created (oldest first)                              

4

I got some additional insight into the issue by consulting this GitHub issue page. As it turns out, if the size from the PyObject is smaller than the size from the C header, an upgrade of the package referenced by the error (here numpy) is necessary to resolve the error, and vice versa.

I was able to resolve the issue by upgrading numpy to version 1.20.0, even though the requirement was numpy<1.19.0.

Share

Follow

edited Jan 31, 2021 at 16:11

answered Jan 31, 2021 at 16:03

Jake

15322 silver badges99 bronze badges

Add a comment

1

Sharing this in case it helps others: I was trying to get fairseq to work and ran into the same issue of ValueError with binary incompatibility as possible reason and Jake's suggestion of updating numpy to 1.20.0 helped solve the problem even through requirements specifically asked for numpy<1.19.0.

Share

Follow

answered Feb 26, 2021 at 7:47

user1722863

5555 bronze badges

Add a comment

0

I ran into the same problem: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject and this solution worked for me. Specifically, using Dockerfile to create an image, I install flair==0.8.0.post1, which requires numpy<1.19.0. But after installing flair==0.8.0.post1 I install numpy==1.20.0 and this has avoided the problem. This section of the Dockerfile is:

RUN pip install flair==0.8.0.post1
RUN pip install numpy==1.20.0

Share

Follow

answered May 17, 2021 at 21:31

user3473556

4711 gold badge11 silver badge9

意思是numpy版本太旧更新就好,更新完了还不行,就推出notebook重新进。

还有就是安装numpy权限不够,加一个user

pip install --user numpy

锐单商城拥有海量元器件数据手册IC替代型号,打造电子元器件IC百科大全!

相关文章