SheffieldML / deepGPy

Deep GPs with GPy
BSD 3-Clause "New" or "Revised" License
31 stars 10 forks source link

Error in iPython example #2

Closed mathDR closed 9 years ago

mathDR commented 9 years ago

on line model1 = build_supervised(X, Y, Qs=(1,), Ms=(15,15)) in the notebook example, I get an error that comes down to: in compute_KL_term in layers.py, line 167, the sizes of self.q_of_U_precision and self.Kmmi[:,:,None] do not align self.q_of_U_precision is (15,15,15) and self.Kmmi[:,:,None] is (15,15,1)

mathDR commented 9 years ago

Follow up: can you run step_fn_demo?

jameshensman commented 9 years ago

Feedback is much appreciated, thanks.

Should be fixed now, check it out!

James.

mathDR commented 9 years ago

Thanks! Works great! Note I built it on a mac running Yosemite, so if there are other people having problems getting it to work, I can post my build steps...

On Thu, Jul 16, 2015 at 9:47 AM, James Hensman notifications@github.com wrote:

Feedback is much appreciated, thanks.

Should be fixed now, check it out!

James.

— Reply to this email directly or view it on GitHub https://github.com/SheffieldML/deepGPy/issues/2#issuecomment-122017892.

yberol commented 8 years ago

@mathDR , I am having some issues running the step_fn_demo (and the ipynb) as well, and just like you I am running Yosemite. I would appreciate it if you can share your build steps.

mathDR commented 8 years ago

@yberol What, specifically are the errors you are getting?

yberol commented 8 years ago

@mathDR Quick info:

When I run the step_fn_demo.py I get this.

Similarly if I try to run the notebook, after the model1 = build_supervised(X, Y, Qs=(1,), Ms=(15,15)) line, I get this.

Thanks for your help!

mathDR commented 8 years ago

The problem lies in your compiler. When you type 'which gcc' I assume you get the clang version sent with apple.

To build and run these types of programs, you are much better off using a fresh gcc.

I use homebrew, so I brew install gcc-5 (The latest), then in my .bashrc file, I create an alias that allows for gcc to compile.

The relevant lines are: alias gcc='gcc-5' alias cc='gcc-5' alias g++='g++-5' alias c++='c++-5'

but, of course you can alias to whatever gcc command you have.

yberol commented 8 years ago

@mathDR well I installed the latest gcc and added the aliases to my .bash_profile. Now gcc --version returns: gcc-5 (Homebrew gcc 5.3.0) 5.3.0, however step_fn_demo.py still gives the same errors as in the previous post. Specifically this part: scipy.weave.build_tools.CompileError: error: Command "g++ -fno-strict-aliasing -I/Users/yusufbugraerol/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/yusufbugraerol/anaconda/lib/python2.7/site-packages/scipy/weave -I/Users/yusufbugraerol/anaconda/lib/python2.7/site-packages/scipy/weave/scxx -I/Users/yusufbugraerol/anaconda/lib/python2.7/site-packages/scipy/weave/blitz -I/Users/yusufbugraerol/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/yusufbugraerol/anaconda/include/python2.7 -c /Users/yusufbugraerol/.cache/scipy/python27_compiled/sc_9354f24db217fdec00d0dd1964056e7a4.cpp -o /var/folders/y5/9t3nq1f1463fnynd8w4dpjf40000gn/T/scipy-yusufbugraerol-AmIDut/python27_intermediate/compiler_a43d27c4d7e0f14e6813041b5f426380/Users/yusufbugraerol/.cache/scipy/python27_compiled/sc_9354f24db217fdec00d0dd1964056e7a4.o -fopenmp -O3" failed with exit status 1

Btw, not sure whether relevant but: which g++ returns /usr/bin/g++ and g++ --version returns g++-5 (Homebrew gcc 5.3.0) 5.3.0

mathDR commented 8 years ago

what does g++ --version return?

yberol commented 8 years ago

@mathDR , sorry just updated it above but: which g++ returns /usr/bin/g++ and g++ --version returns g++-5 (Homebrew gcc 5.3.0) 5.3.0 similarly which gcc: /usr/bin/gcc and cc --version: gcc-5 (Homebrew gcc 5.3.0) 5.3.0

mathDR commented 8 years ago

I don't use anaconda, but maybe you need to rebuild your python with the new compiler engaged?

yberol commented 8 years ago

@mathDR maybe, I will check that out. Quick question though: which g++ returns /usr/bin/g++ instead of usr/local/bin which is where homebrew installed the gcc binaries. Should I add something like export PATH=/usr/local/bin:$PATH to the bash_profile? If that is not the case, I will probably go for a clean install of anaconda as you recommended.

yberol commented 8 years ago

I added export PATH=/usr/local/bin:$PATH to the bash_profile and created a symbolic link and on top of it did a clean install of anaconda. It seems to be working now. @mathDR , thanks a lot for your help!

mathDR commented 8 years ago

Great! I suspect it was your path not linking to g++. Glad to be of some help