Skip to content
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

Cannot import Kuu name #37

Open
Mirgahney opened this issue Feb 18, 2019 · 6 comments
Open

Cannot import Kuu name #37

Mirgahney opened this issue Feb 18, 2019 · 6 comments

Comments

@Mirgahney
Copy link

Hi Hugh,

We I was trying to import deep GP from doubly_stochastic_dgp.dgp import DG I get the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-a6c15c619455> in <module>()
     13 from scipy.cluster.vq import kmeans2
     14 
---> 15 from doubly_stochastic_dgp.dgp import DGP
     16 
     17 import time

D:\Users\mar\Anaconda3\lib\site-packages\doubly_stochastic_dgp-1.0-py3.6.egg\doubly_stochastic_dgp\dgp.py in <module>()
     29 
     30 from doubly_stochastic_dgp.utils import BroadcastingLikelihood
---> 31 from doubly_stochastic_dgp.layer_initializations import init_layers_linear
     32 from doubly_stochastic_dgp.layers import GPR_Layer, SGPMC_Layer, GPMC_Layer, SVGP_Layer
     33 

D:\Users\mar\Anaconda3\lib\site-packages\doubly_stochastic_dgp-1.0-py3.6.egg\doubly_stochastic_dgp\layer_initializations.py in <module>()
     12 float_type = settings.float_type
     13 
---> 14 from doubly_stochastic_dgp.layers import SVGP_Layer
     15 
     16 def init_layers_linear(X, Y, Z, kernels,

D:\Users\mar\Anaconda3\lib\site-packages\doubly_stochastic_dgp-1.0-py3.6.egg\doubly_stochastic_dgp\layers.py in <module>()
     18 import gpflow
     19 from gpflow.params import Parameter, Parameterized
---> 20 from gpflow.conditionals import conditional, Kuu
     21 from gpflow.features import InducingPoints
     22 from gpflow.kullback_leiblers import gauss_kl

ImportError: cannot import name 'Kuu'

and I'm using GPflow 1.1.1

@hughsalimbeni
Copy link
Collaborator

Hi thanks for pointing this out. The code is not compatible with gpflow1.1. It should work with gpflow1.0, however.

I will try to refactor the code for compatibility with gpflow1.1 later today.

@hughsalimbeni
Copy link
Collaborator

I've thought a bit more about this and think it's not worth refactoring right now as tensorflow2 and gpflow2 are very soon to be released. These new version will incur major refactoring, including much simplification (e.g. no autoflow), so I don't think it's worth changing things at this stage. To get the above code to work the Kuu import can be dropped and then the matrix can be created using something likekern.K(Z) + tf.eye(M) * jitter

@LanyeHu
Copy link

LanyeHu commented Aug 19, 2019

Hi, I am facing the same problem with gpflow 1.5.0 , tensorflow 1.14.0 and python 3.7
AttributeError: 'InducingPoints' object has no attribute 'Kuu'
Tensorflow 1.8 is incompatible for python 3.7.
After installing gpflow 1.0 here's another problem
from gpflow.training import AdamOptimizer ImportError: cannot import name 'AdamOptimizer' from 'gpflow.training' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gpflow/training/__init__.py)

@hughsalimbeni
Copy link
Collaborator

Perhaps try gpflow1.4?

@hughsalimbeni
Copy link
Collaborator

Or 1.1

@LanyeHu
Copy link

LanyeHu commented Aug 22, 2019

Thanks. I changed the version of gpflow to 1.3.0, tensorflow to 1.13.1 and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants