It seems that you might have written this over a year ago, so sorry to bother you...I'm running with TF 0.12.1, which is released a year ago (hopefully the same version that you used). And i got this error when running the example program:
Traceback (most recent call last):
File "gaussian_sampler_example.py", line 74, in <module>
num_steps=10)
File "/../hamiltonian_monte_carlo.py", line 98, in hmc
p_accept = min(1.0, tf.exp(orig - current))
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 547, in __nonzero__
raise TypeError("Using a `tf.Tensor` as a Python `bool` is not allowed. "
TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
Basically this line is problematic:
p_accept = min(1.0, tf.exp(orig - current))
I'm wondering if you are able to run the sample program and if there's a easy fix to this...
Hi,
It seems that you might have written this over a year ago, so sorry to bother you...I'm running with TF 0.12.1, which is released a year ago (hopefully the same version that you used). And i got this error when running the example program:
Basically this line is problematic:
I'm wondering if you are able to run the sample program and if there's a easy fix to this...