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

I am trying to get numpy<1.19.0 and ConfigSpace==0.4.16 to work in a python==3.7 conda environment. The installed version of numpy is 1.18.5.

I am getting the following error:

Traceback (most recent call last):
  File "/home/user/.conda/envs/deephyper/bin/deephyper", line 5, in <module>
    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 <module>
    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 <module>
    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 <module>
    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 <module>
    from deephyper.search.search import Search
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/search/search.py", line 8, in <module>
    from deephyper.evaluator.evaluate import Evaluator
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/evaluator/__init__.py", line 5, in <module>
    from deephyper.evaluator.evaluate import Encoder
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/deephyper/evaluator/evaluate.py", line 15, in <module>
    import skopt
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/__init__.py", line 45, in <module>
    from . import callbacks
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/callbacks.py", line 17, in <module>
    from skopt.utils import dump
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/utils.py", line 19, in <module>
    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 <module>
    from .lhs import Lhs
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/sampler/lhs.py", line 9, in <module>
    from ..space import Space, Categorical
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/space/__init__.py", line 5, in <module>
    from .space import *
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/skopt/space/space.py", line 27, in <module>
    import ConfigSpace as CS
  File "/home/user/.conda/envs/deephyper/lib/python3.7/site-packages/ConfigSpace/__init__.py", line 37, in <module>
    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 of numpy or removing all numpy installations and reinstalling numpy and ConfigSpace with pip options --no-cache-dir --no-binary, but the error persists.

Are there other potential solutions that I could try?

pythonpython-3.xpipruntime-errorcompatibility

Share

Follow

edited Jan 31, 2021 at 1:08

asked Jan 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)                                                                   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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

十年后一起潇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值