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

PyMC causes theano to crash #783

Closed
vhaasteren opened this issue Jul 5, 2015 · 6 comments
Closed

PyMC causes theano to crash #783

vhaasteren opened this issue Jul 5, 2015 · 6 comments

Comments

@vhaasteren
Copy link

I am trying out a tutorial of Theano, and I notice that pymc3 makes it throw a ValueError. The code below fails. However, if I simply remove the pymc3 import, it runs fine. Example:

import pymc3 as pm
import theano as th

print(pm.version)

3.0

print(th.version)

0.7.0.dev-3e84371d4e0f4d24c5bc784291ee8c0d85e84005

a = th.tensor.dscalar()
b = th.tensor.dscalar()
c = a + b

ValueError Traceback (most recent call last)
in ()
4
5 # create a simple expression
----> 6 c = a + b

/Users/vhaaster/env/pint/lib/python2.7/site-packages/theano/tensor/var.pyc in add(self, other)
131 def add(self, other):
132 try:
--> 133 return theano.tensor.basic.add(self, other)
134 # We should catch the minimum number of exception here.
135 # Otherwise this will convert error when Theano flags

/Users/vhaaster/env/pint/lib/python2.7/site-packages/theano/gof/op.pyc in call(self, _inputs, *_kwargs)
524 run_perform = False
525 elif config.compute_test_value == 'raise':
--> 526 raise ValueError('Cannot compute test value: input %i (%s) of Op %s missing default value' % (i, ins, node))
527 elif config.compute_test_value == 'ignore':
528 # silently skip test

ValueError: Cannot compute test value: input 0 (<TensorType(float64, scalar)>) of Op Elemwise{add,no_inplace}(<TensorType(float64, scalar)>, <TensorType(float64, scalar)>) missing default value

@twiecki
Copy link
Member

twiecki commented Jul 5, 2015

This is probably caused by #566

@jsalvatier
Copy link
Member

@vhaasteren there's some ideas on how to do this in #566 like thomas said. Would you be interested in making a pull request to fix this?

@vhaasteren
Copy link
Author

@jsalvatier I am definitely willing to contribute. However, given that my first experience with PyMC was two days ago (looks very cool, btw), I am not sure of how much help I can be until I familiarize myself a bit more with the codebase. I will look into it

@jsalvatier
Copy link
Member

Makes sense: the relevant things are in https://github.com/pymc-devs/pymc3/blob/master/pymc3/model.py. The class Model inherits from Context, and theano.config.compute_test_value = 'raise' is done at the bottom of the file, which are likely the things you want to change.

Let me know if you want to chat for help.

@vhaasteren
Copy link
Author

Thank you for the pointers, that is a good start. I will be in touch if I need help.

@fonnesbeck
Copy link
Member

Closing. Please re-open if you need additional support.

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

4 participants