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.
Try adding init='adapt_diag'
when you call pm.sample
.
More here: Frequently Asked Questions
1 Like
Adding init='adapt_diag'
get it a little further but then I get a different error: ValueError: Mass matrix contains zeros on the diagonal.
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.