Model rejects data then runs after a few tries

I have a model running against a data set. initial tries either fails immediately with

'might be misspecified.' %

or run to about 3% and fails with

ValueError: Mass matrix contains zeros on the diagonal. Some derivatives might always be zero.

But, without fixing anything, it suddenly starts running and run to the end.

Is this a known behavior? that sometimes you just have to try random new starts?

I see the topic discussed in FAQ, but I am not sure I actually have a problem given the inconsistent behavior.

Now I have a case where it fails consistently with ‘might be misspecified.’ % when using gpu, but runs along fine using cpu. What could the reason for that?

Sometimes the problem lies with one of the random variables having a really large range that it varies over. The ValueError often stems from that. You might want to check the ranges of the variables in your model and reparametrize if that’s the case.