Error: NotImplementedError: Cannot convert 'μ' to a tensor variable

Hello: I am getting this error “NotImplementedError: Cannot convert ‘μ’ to a tensor variable.” when I try to run Code 8.2, page 237 in Bayesian Modeling and Computation in Python.

I’ve installed pymc5 - can you help please.

Thank you!

Make sure you use PyTensor and not Aesara or Theano

Hi Ricardov94 -

I am not using either - I am trying to recreate this example. (see Code 8.2 and 8.3). Neither the model code nor the imports import either PyTensor, Theano or Aesara.

Do I need to import PyTensor or add specific PyTensor lines here?

That example uses the old pymc3 package, you may have installed the most recent pymc (without the 3) which is why you are seeing the errors.

Ok - to get this working, do I need to just import PyTensor? From the PyMC example on this page, there is no mention of PyTensor either.

This notebook may get you on the right track.

That was very useful - thank you! I had an incorrect version and that’s now corrected

1 Like