I get "Bad initial energy" even on one of the examples

#1

I had run into the “Bad initial energy” error on a simple GLM model which I created. I decided to try out one of the official examples from the PyMC3 website (https://docs.pymc.io/notebooks/GLM-logistic.html) and I’m still getting this error.

#2

Try adding init='adapt_diag' when you call pm.sample.
More here: Frequently Asked Questions

1 Like
#3

Adding init='adapt_diag' get it a little further but then I get a different error: ValueError: Mass matrix contains zeros on the diagonal.

#4

I just uninstalled the PyMC3 package from PyPI and the installed the lastest version from github and everything seems to work OK now. There might be an issue with the PyPI hosted package because I could not even get it to run even simple examples from the docs.