Is there an example on how to work with generalized mixture models?

There is a known recurrent issue that happens on windows when sample is run with multiple cores. The problem is not actually restricted to windows. Unix OSes don’t show it so often because the multiprocessing backend defaults to fork, which behaves better than spawn and forkserver which are the available backends on windows.

The errors are very diverse but your particular issue looks strongly related to this and this issues. It is clearly a theano related problem in which the spawned process for some reason that we don’t understand yet, fails to compile the model’s logp (what actually happens is that it tries to unpickle a theano.function and to do so, it tries to recompile it in the new process). The only work around we have for now is to run sample with cores=1.