栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

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

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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 
    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 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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1030478.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号