-
Notifications
You must be signed in to change notification settings - Fork 566
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: numpy.ndarray size changed... when I try to import GPy #936
Comments
Hi, (I'm not a GPy specialist, btw) $ python -c 'import GPy'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\USRE\Anaconda3\envs\picon\lib\site-packages\GPy\__init__.py", line 6, in <module>
from . import core
File "C:\Users\USER01\Anaconda3\envs\picon\lib\site-packages\GPy\core\__init__.py", line 49, in <module>
from .gp import GP
File "C:\Users\USER01\Anaconda3\envs\picon\lib\site-packages\GPy\core\gp.py", line 8, in <module>
from .. import likelihoods
File "C:\Users\USER01\Anaconda3\envs\picon\lib\site-packages\GPy\likelihoods\__init__.py", line 25, in <module>
from .bernoulli import Bernoulli
File "C:\Users\USER01\Anaconda3\envs\picon\lib\site-packages\GPy\likelihoods\bernoulli.py", line 5, in <module>
from ..util.univariate_Gaussian import std_norm_pdf, std_norm_cdf, derivLogCdfNormal, logCdfNormal
File "C:\Users\USER01\Anaconda3\envs\picon\lib\site-packages\GPy\util\__init__.py", line 11, in <module>
from . import linalg
File "C:\Users\USER01\Anaconda3\envs\picon\lib\site-packages\GPy\util\linalg.py", line 15, in <module>
from . import linalg_cython
File "GPy/util/linalg_cython.pyx", line 1, in init GPy.util.linalg_cython
from libc.math cimport sqrt
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
$ pip uninstall numpy -y && pip install numpy==1.20.0
Found existing installation: numpy 1.19.0
Uninstalling numpy-1.19.0:
Successfully uninstalled numpy-1.19.0
Collecting numpy==1.20.0
Downloading numpy-1.20.0-cp37-cp37m-win_amd64.whl (13.6 MB)
Installing collected packages: numpy
Successfully installed numpy-1.20.0
$ python -c 'import GPy'
$ python -V
Python 3.7.0
$ pip list | grep GPy
GPy 1.10.0 Best, |
Thanks for the comment @sshojiro |
This actually is the same as #974. pip compiles GPy against the currently installed NumPy, or the latest one if no NumPy is installed, because the build requirement is wrong. Then a previous (ABI-incompatible) version of NumPy is installed because of the TensorFlow requirement. This should be fixed by #975. As a workaround, you can try to install an older version of NumPy (such as 1.17), compile GPy against it, and then upgrade the NumPy version. |
Hello
I installed the latest GPy version using pip install, but when I try importing I have the error:
from . import linalg_cython
File "GPy/util/linalg_cython.pyx", line 1, in init GPy.util.linalg_cython
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
Some solutions on the internet tell to just try uninstalling and installing NumPy. This changes the NumPy version to the latest one(1.20.x) which is not compatible with TensorFlow. Tensorflow works with only numpy <= 1.19.5
Can you please help me in resolving this so that I can use both TensorFlow and GPy together
Thanks in advance!
The text was updated successfully, but these errors were encountered: