caravagnalab / rcongas

rcongas
GNU General Public License v3.0
7 stars 1 forks source link

best_cluster: "Model not present, please run list_models() to see what is available" #27

Closed moshl closed 8 months ago

moshl commented 1 year ago

Hi, Thanks for the awesome package! I run the exmple_data, but meet the error as below: inference <- best_cluster(input_rcongas, clusters = 1:5, model = "MixtureGaussian", param_list = list(theta_shape = theta_vals[1], theta_rate = 1), steps = 500, lr = 0.01, MAP = TRUE, seed = 3, normalize_by_segs = FALSE, method = "ICL") [1] "Model not present, please run list_models() to see what is available" Error in eval(expr, envir, enclos): TypeError: 'str' object is not callable

Traceback:

  1. best_cluster(input_rcongas2, clusters = 1:5, model = "mixturegaussian", . param_list = list(theta_shape = theta_vals[1], theta_rate = 1), . steps = 500, lr = 0.01, MAP = TRUE, seed = 3, normalize_by_segs = FALSE, . method = "ICL")
  2. lapply(clusters, function(x) run_inference(X = X, model = model, . optim = optim, elbo = elbo, inf_type = inf_type, steps = steps, . lr = lr, param_list = c(param_list, list(K = x, mixture = mixture[[x]])), . MAP = MAP, seed = seed, ))
  3. FUN(X[[i]], ...)
  4. run_inference(X = X, model = model, optim = optim, elbo = elbo, . inf_type = inf_type, steps = steps, lr = lr, param_list = c(param_list, . list(K = x, mixture = mixture[[x]])), MAP = MAP, seed = seed, . )
  5. int$initialize_model(data_list)
  6. py_call_impl(callable, dots$args, dots$keywords)
Militeee commented 1 year ago

Hi @moshl it looks like this is an issue with the function call in Python. As we are releasing a new version of the package we might have some conflicts. I'm on annual leavetoday, I'll try to have a look at it tomorrow. Thanks for using CONGAS

Militeee commented 1 year ago

So as a first check can you copy the output of

reticulate::py_config()