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

Error using MCMC #204

Open
doctorwes opened this issue Feb 15, 2020 · 2 comments
Open

Error using MCMC #204

doctorwes opened this issue Feb 15, 2020 · 2 comments

Comments

@doctorwes
Copy link

I am using the same model as in #195 (closed; thank you!), but attempting to use MCMC rather than VI.

(Note that I can successfully run the sample notebook MCMC-logregression.ipynb)

MC = inf.inference.MCMC(num_results=1000)
m.fit({"x": data}, MC)

I get the following error:

---------------------------------------------------------------------------
FailedPreconditionError                   Traceback (most recent call last)
/home/wkp/.conda/envs/WKPenv/lib/python3.6/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1355     try:
-> 1356       return fn(*args)
   1357     except errors.OpError as e:

/home/wkp/.conda/envs/WKPenv/lib/python3.6/site-packages/tensorflow/python/client/session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata)
   1340       return self._call_tf_sessionrun(
-> 1341           options, feed_dict, fetch_list, target_list, run_metadata)
   1342 

/home/wkp/.conda/envs/WKPenv/lib/python3.6/site-packages/tensorflow/python/client/session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata)
   1428         self._session, options, feed_dict, fetch_list, target_list,
-> 1429         run_metadata)
   1430 

FailedPreconditionError: Error while reading resource variable mcmc_sample_chain_1/mh_bootstrap_results/hmc_kernel_bootstrap_results/maybe_call_fn_and_grads/value_and_gradients/value_and_gradient/dense_40/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/mcmc_sample_chain_1/mh_bootstrap_results/hmc_kernel_bootstrap_results/maybe_call_fn_and_grads/value_and_gradients/value_and_gradient/dense_40/bias/N10tensorflow3VarE does not exist.
	 [[{{node mcmc_sample_chain_1/mh_bootstrap_results/hmc_kernel_bootstrap_results/maybe_call_fn_and_grads/value_and_gradients/value_and_gradient/dense_40/BiasAdd/ReadVariableOp}}]]
@rcabanasdepaz
Copy link
Member

For probabilistic models with (trainable) NNs, it is not possible to use MCMC. Instead, you should use variational inference.

@doctorwes
Copy link
Author

doctorwes commented Feb 24, 2020 via email

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