ndcbe / cbe67701-uncertainty-quantification

Summer 2020 reading group on uncertainty quantification
https://ndcbe.github.io/cbe67701-uncertainty-quantification/
22 stars 6 forks source link

Verify notebook 10.2 runs on Colab #48

Open adowling2 opened 4 years ago

adowling2 commented 4 years ago

When I run the notebook with this version of Jupyter:

Python 3.6.7 | packaged by conda-forge | (default, Jul  2 2019, 02:07:37) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]

I get the following error in cell 5 on import GPy:

ValueError                                Traceback (most recent call last)
<ipython-input-5-27f6555b06bd> in <module>
----> 1 import GPy
      2 X_init = X_init.reshape(-1,1)
      3 Y_init = f(X_init)
      4 ## the squared-exponential kernel
      5 gpy_model = GPy.models.GPRegression(X=X_init, Y=f(X_init), kernel=GPy.kern.RBF(

~/.local/lib/python3.6/site-packages/GPy/__init__.py in <module>
      4 warnings.filterwarnings("ignore", category=DeprecationWarning)
      5 
----> 6 from . import core
      7 from . import models
      8 from . import mappings

~/.local/lib/python3.6/site-packages/GPy/core/__init__.py in <module>
      6 from . import parameterization
      7 
----> 8 from .gp import GP
      9 from .svgp import SVGP
     10 from .sparse_gp import SparseGP

~/.local/lib/python3.6/site-packages/GPy/core/gp.py in <module>
      6 from .parameterization.variational import VariationalPosterior
      7 from .mapping import Mapping
----> 8 from .. import likelihoods
      9 from .. import kern
     10 from ..inference.latent_function_inference import exact_gaussian_inference, expectation_propagation

~/.local/lib/python3.6/site-packages/GPy/likelihoods/__init__.py in <module>
----> 1 from .bernoulli import Bernoulli
      2 from .exponential import Exponential
      3 from .gaussian import Gaussian, HeteroscedasticGaussian
      4 from .gamma import Gamma
      5 from .poisson import Poisson

~/.local/lib/python3.6/site-packages/GPy/likelihoods/bernoulli.py in <module>
      3 
      4 import numpy as np
----> 5 from ..util.univariate_Gaussian import std_norm_pdf, std_norm_cdf, derivLogCdfNormal, logCdfNormal
      6 from . import link_functions
      7 from .likelihood import Likelihood

~/.local/lib/python3.6/site-packages/GPy/util/__init__.py in <module>
      3 
      4 
----> 5 from . import linalg
      6 from . import misc
      7 from . import squashers

~/.local/lib/python3.6/site-packages/GPy/util/linalg.py in <module>
     13 
     14 try:
---> 15     from . import linalg_cython
     16     use_linalg_cython = config.getboolean('cython', 'working')
     17 except ImportError:

__init__.pxd in init GPy.util.linalg_cython()

ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

@Zhuogang Did you try this notebook on Colab or did you Python on your local computer? What version of Jupyter and Python are you using?

adowling2 commented 4 years ago

This might be a numpy issue: https://github.com/scikit-learn-contrib/hdbscan/issues/272

Zhuogang commented 4 years ago

It works fine in my laptop. I am using Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32. I did not figure out why it does not work on colab.

adowling2 commented 4 years ago

Ah, that is a pretty old version of Python and Anacoda. The issue I posted with sckit-learn suggested downgrading to numpy 1.16.1.