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 create a Normal distribution with carl 0.2, Theano 0.8.2 #60

Open
gnperdue opened this issue Apr 3, 2017 · 3 comments
Open

Cannot create a Normal distribution with carl 0.2, Theano 0.8.2 #60

gnperdue opened this issue Apr 3, 2017 · 3 comments

Comments

@gnperdue
Copy link

gnperdue commented Apr 3, 2017

Hello,

I am attempting to test this library, but running into problems quickly. The versions of relevant libraries I have are:

$ python pyverchecker.py
Python version: 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
pandas version: 0.19.2
matplotlib version: 2.0.0
numpy version: 1.12.0
scipy version: 0.19.0
IPython version: 5.3.0
sklearn version: 0.18
pymc3 version: 3.0
theano version: 0.8.2
carl version: 0.2
h5py version: 2.6.0

If I try to instantiate a Normal, I get:

(py2th) ~$ ipython
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08)
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from carl.distributions import Normal

In [2]: pnorm = Normal(mu=0.0, sigma=1.0)
ERROR (theano.gof.opt): Optimization failure due to: local_mul_canonizer
ERROR (theano.gof.opt): node: Elemwise{true_div,no_inplace}(Elemwise{mul,no_inplace}.0, Elemwise{pow,no_inplace}.0)
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
  File "/Users/gnperdue/anaconda/envs/py2th/lib/python2.7/site-packages/theano/gof/opt.py", line 1772, in process_node
    replacements = lopt.transform(node)
  File "/Users/gnperdue/anaconda/envs/py2th/lib/python2.7/site-packages/theano/tensor/opt.py", line 4505, in transform
    new = self.merge_num_denum(num, denum)
  File "/Users/gnperdue/anaconda/envs/py2th/lib/python2.7/site-packages/theano/tensor/opt.py", line 4327, in merge_num_denum
    return self.inverse(self.merge_num_denum(num, []),
  File "/Users/gnperdue/anaconda/envs/py2th/lib/python2.7/site-packages/theano/tensor/opt.py", line 4326, in merge_num_denum
    return self.main(*num)
  File "/Users/gnperdue/anaconda/envs/py2th/lib/python2.7/site-packages/theano/gof/op.py", line 633, in __call__
    (i, ins, node))
ValueError: Cannot compute test value: input 1 (Elemwise{pow,no_inplace}.0) of Op Elemwise{mul,no_inplace}(DimShuffle{x,x}.0, Elemwise{pow,no_inplace}.0) missing default value

There is actually a long spew of errors, all ending in ValueErrors that complain about "missing default values."

Any suggestions?

Thanks!

pax
Gabe

@glouppe
Copy link
Contributor

glouppe commented Apr 4, 2017

Thanks for the report! I'll try looking into this asap.

(I checked on a fresh Python 3 environment and all works fine. Certainly due to Python 2.)

@gnperdue
Copy link
Author

gnperdue commented Apr 4, 2017

Thanks. I forgot to mention I am using a Mac and installed basically everything via conda-forge.

@gnperdue
Copy link
Author

gnperdue commented Apr 5, 2017

I can confirm this works for me with Python 3 (but different Theano version - 0.9) - so this does look like a Python 2 issue:

(py3th) $ python pyverchecker.py
Python version: 3.5.3 |Continuum Analytics, Inc.| (default, Mar  6 2017, 12:15:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
pandas version: 0.19.2
matplotlib version: 2.0.0
numpy version: 1.12.1
scipy version: 0.19.0
IPython version: 5.3.0
sklearn version: 0.18.1
tensorflow version: 1.0.0
pymc3 version: 3.0
theano version: 0.9.0
carl version: 0.2
h5py version: 2.7.0
Using TensorFlow backend.
keras version: 2.0.2
Note, Keras configuration is in $HOME/.keras/keras.json
(py3th) $ ipython
Python 3.5.3 |Continuum Analytics, Inc.| (default, Mar  6 2017, 12:15:08)
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from carl.distributions import Normal

In [2]: pnorm = Normal(mu=0.0, sigma=1.0)

In [3]:

I posted my Anaconda config script here (should it somehow matter):

https://github.com/gnperdue/BashDotFiles/tree/master/anaconda_configs

After setting up Anaconda, I just clone and install Carl via setup.py.

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

2 participants