We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b13db84 commit cdb1a51Copy full SHA for cdb1a51
R/utilities.R
@@ -316,8 +316,11 @@ vb_iterative = function(model,
316
return(my_res)
317
},
318
error = function(e) {
319
-
320
- writeLines(sprintf("Further attempt with Variational Bayes: %s", e))
+ if(e$message |> str_detect("The Stan file used to create the `CmdStanModel` object does not exist\\.")) {
+ clear_stan_model_cache()
321
+ model <<- load_model(model_name, force=TRUE, threads = cores)
322
+ }
323
+ else writeLines(sprintf("Further attempt with Variational Bayes: %s", e))
324
325
return(NULL)
326
@@ -586,6 +589,7 @@ fit_model = function(
586
589
587
590
588
591
} else{
592
+
593
if(inference_method=="pathfinder") init = pf
594
else if(inference_method=="variational") init = list(init_list)
595
0 commit comments