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
Issues running examples #248
Comments
I have a similar dimension error for the getting started example. I have only installed the library yesterday, so I haven't had time to find out what was wrong. |
The error is slightly different for the getting started. There, it's an issue of an object having dimension (50,1,5) not being of rank 2. |
Thanks for letting us know! It sounds like the broadcasting behavior is different. However, I'm not sure what may be leading to this issue from an Anaconda install. @evoclue: are you using Anaconda as well? One recommendation is to use the latest version of TensorFlow (r0.10) if you aren't already. Another recommendation would be to try the git-developed version: pip install -e "git+https://github.com/blei-lab/edward.git#egg=edward" |
I'm using TensorFlow 0.10 and I just tried using edward from the git version. I'm still getting the same error. |
@dustinvtran No, I installed everything using pip. I have the latest version of TF and the git version of edward. Another error I get is in mixture_density_network.py:
In vae.py, I get another error:
I haven't tried all the examples. Not sure if it would help, but here is my |
Following @evoclue's note, it does sound like the latest Edward version is not being used. Can you try the following? import edward as ed
print(ed.placeholder)
|
In [4]: print(ed.placeholder) It appears to be available |
@jnoppenheim: Can you try running |
@dustinvtran (tensorflow)Orbis:edward joppenheim$ python examples/mixture_density_network.py
|
It runs within ipython but not from the command line. |
Actually, I can run bayesian_linear_regression through ipython too. This is very odd. |
Yes that's very odd.. It sounds like a weird scoping issue. ipython and Python may be using different Python and/or package versions. |
@dustinvtran I updated to 1.1.2 and now the errors are gone. Although now in the mixture_density_network.py and vae.py I get the error:
Creating the dict outside the update function gives the error:
I also ran the mixture_gaussian.py that @jnoppenheim got an error on, but it didn't get that error anymore, but during the
|
Perfect! Glad the latest version fixed it. re:MDN example. The re:mixture gaussian example. Looks like it's the result of numerical instability. I came across that a few times during particular settings of the algorithm parameters. You can see it in the error here, |
Hi! I'm trying the tf_mixture_gaussian.py example and I have the same error as @evoclue. I have these packages in my virtualenv: Tensorflow 0.10 and the developer version of Edward. And this is the error:
When I have tried in ipython it has left me the same error. |
Oddly enough, I still can't run mixture_gaussian.py either for what looks like the original broadcast error. I have no problem running any other example: `In [1]: run mixture_gaussian.pyValueError Traceback (most recent call last) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.pyc in run(self, _args, *_kwargs) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.pyc in initialize(self, n_samples, score, _args, *_kwargs) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.pyc in initialize(self, n_iter, n_minibatch, n_print, optimizer, scope, logdir) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.pyc in build_loss(self) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.pyc in build_score_loss(self) /Users/joppenheim/Projects/src/edward/examples/mixture_gaussian.py in log_prob(self, xs, zs) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.pyc in binary_op_wrapper(x, y) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.pyc in _mul_dispatch(x, y, name) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.pyc in mul(x, y, name) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.pyc in apply_op(self, op_type_name, name, **keywords) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.pyc in create_op(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_shapes, compute_device) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.pyc in set_shapes_for_outputs(op) /Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.pyc in _BroadcastShape(op) ValueError: Incompatible shapes for broadcasting: (20,) and (2,) ` |
@bertini36: Yeah that makes sense. That example seems very sensitive as score function gradients are highly stochastic. It works for certain commits and can easily break in other commits. I'll change it to use a different algorithm. @jnoppenheim: Possibly a cached issue? Looks like it's trying to multiply a vector of 1 with 20 elements against |
@dustinvtran |
+1, I get the same error at times! |
Model wrappers no longer supported. |
Hi,
I've had a handful of issues trying to run the mixture gaussians and the bayesian linear regression examples. For reference, I installed tensorflow through anaconda using a separate environment. I then installed edward in this environment. I can run several of the examples, but it appears that something in the normal models is causing errors.
For instance, when running mixture_gaussians.py, I end up with:
(tensorflow)Orbis:Edward joppenheim$ python mixture_gaussian.py
Traceback (most recent call last):
File "mixture_gaussian.py", line 144, in
inference.run(n_iter=2500, n_samples=10, n_minibatch=20)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.py", line 184, in run
self.initialize(_args, *_kwargs)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.py", line 367, in initialize
return super(MFVI, self).initialize(_args, *_kwargs)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.py", line 243, in initialize
loss = self.build_loss()
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.py", line 411, in build_loss
return self.build_score_loss()
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/edward/inferences.py", line 437, in build_score_loss
p_log_prob = self.model_wrapper.log_prob(x, z)
File "mixture_gaussian.py", line 80, in log_prob
matrix += [tf.ones(N) * tf.log(pi[k]) +
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 760, in binary_op_wrapper
return func(x, y, name=name)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 909, in _mul_dispatch
return gen_math_ops.mul(x, y, name=name)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 1464, in mul
result = _op_def_lib.apply_op("Mul", x=x, y=y, name=name)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2319, in create_op
set_shapes_for_outputs(ret)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1711, in set_shapes_for_outputs
shapes = shape_func(op)
File "/Users/joppenheim/anaconda/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 1809, in _BroadcastShape
% (shape_x, shape_y))
ValueError: Incompatible shapes for broadcasting: (20,) and (2,)
That 20 comes from the n_minibatch parameter.
A similar error occurred with Bayesian Linear Regression.
Any thoughts?
The text was updated successfully, but these errors were encountered: