One solution is to adopt a nonparametric Bayesian method by incorporating a hierarchical prior over the parameters (e.g., a Dirichlet process).
this approach can impose unrealistic restrictions on the model choice and result in intractability which requires sampling or approximate inference to overcome.