Error fitting model in Windows cmdstanr - metadata data type

I’ve installed cmdstanr on a windows laptop which seemed to go successfully, and I can compile models fine but I get a strange error when I come to sample from them.

As a demonstration running the example model gives the following error:

library(cmdstanr)
cmdstanr_example()
Compiling Stan program...
Error in !is.null(csv_contents$metadata$save_warmup) && csv_contents$metadata$save_warmup :
  invalid 'y' type in 'x && y'

If I load the CSV contents I can see that the metadata$save_warmup field is set to the character string ‘false’, rather than a R boolean FALSE or TRUE. If I explicitly pass save_warmup=TRUE then it is true. Either way, it is not parsed as an R boolean hence the if statement failing.

Any ideas what could be causing this or how I can get around it?

I’m on R 4.3.2 with cmdstanr 0.7.1 with cmdstan version 2.35.0

1 Like

You need to upgrade your version of cmdstanr - the current is 0.8.1

1 Like

Brilliant, that fixed it. Thanks!

1 Like