Could you help me with dirichlet process mixture model?

Did you check the Dirichlet process example here? I would definitely recommend replacing the loop with vector operations as in the example and checking if your problems persist.
http://docs.pymc.io/notebooks/dp_mix.html