Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fit$summary() throws error #383

Closed
bob-carpenter opened this issue Dec 3, 2020 · 13 comments
Closed

fit$summary() throws error #383

bob-carpenter opened this issue Dec 3, 2020 · 13 comments
Labels
bug Something isn't working

Comments

@bob-carpenter
Copy link
Contributor

Describe the bug

> fit <- mod$sample(data = data,
                  init = 0.25,
                  chains = 1, parallel_chains = 4,
                  iter_warmup = 100, iter_sampling = 100,
		  refresh = 1)	     

...reporting on chains running...

> > fit$summary()
Error in UseMethod("variables") : 
  no applicable method for 'variables' applied to an object of class "NULL"

To Reproduce

See above.

Expected behavior

Print fit object.

Operating system

> sessionInfo()
R version 4.0.1 (2020-06-06)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] cmdstanr_0.2.1

loaded via a namespace (and not attached):
 [1] ps_1.3.3          crayon_1.3.4      R6_2.4.1          lifecycle_0.2.0   jsonlite_1.6.1   
 [6] backports_1.1.8   posterior_0.1.0   magrittr_1.5      pillar_1.4.4      rlang_0.4.6      
[11] rstudioapi_0.11   data.table_1.13.0 vctrs_0.3.1       checkmate_2.0.0   ellipsis_0.3.1   
[16] tools_4.0.1       yaml_2.2.1        abind_1.4-5       compiler_4.0.1    processx_3.4.2   
[21] pkgconfig_2.0.3   tibble_3.0.1     

CmdStanR version number

See above.

Additional context

Downloaded cmdstan using the built-in function from CmdStanR and rebuilt to deal with PCH issue.

@bob-carpenter bob-carpenter added the bug Something isn't working label Dec 3, 2020
@rok-cesnovar
Copy link
Member

Thanks for the report.

Are you still in this state? Can you check fit$output_files() to print the resulting CSV files and see if the CSV files look correct?

@jgabry
Copy link
Member

jgabry commented Dec 3, 2020

@rok-cesnovar I think this error is because we need to require a newer version of the posterior package. I don't know what changed in cmdstanr that requires a newer version of posterior, but we always test against the latest posterior so that's probably why this wasn't caught by our tests. We may need to start testing against multiple versions of posterior to avoid something like this.

@bob-carpenter Can you try updating the posterior package with devtools::install_github("stan-dev/posterior") and then see if the error goes away? Sorry for the hassle.

@mitzimorris
Copy link
Member

Bob has gone back to using RStan

@rok-cesnovar
Copy link
Member

I think this error is because we need to require a newer version of the posterior package.

But we didn't change anything in posterior apart from some speedup? Or did I miss anything?

@jgabry
Copy link
Member

jgabry commented Dec 3, 2020

We must have changed something in cmdstanr? I tried installing the same version of posterior bob had and I got that error.

@rok-cesnovar
Copy link
Member

Ah yes, https://github.com/stan-dev/cmdstanr/blob/master/DESCRIPTION#L30 we still point to 0.1.0

@rok-cesnovar
Copy link
Member

We may need to start testing against multiple versions of posterior to avoid something like this.

Will add that.

@bob-carpenter
Copy link
Contributor Author

Are you still in this state? Can you check fit$output_files() to print the resulting CSV files and see if the CSV files look correct?

I closed, but can try to recreate if you still need me to.

Bob has gone back to using RStan

That's because I have a project I need to get done and couldn't get CmdStanR installed and working properly. I filed the issue because I hope to use it when I can get it installed.

@jgabry
Copy link
Member

jgabry commented Dec 3, 2020

That's because I have a project I need to get done and couldn't get CmdStanR installed and working properly. I filed the issue because I hope to use it when I can get it installed.

Sorry I completely misunderstood! Thanks for offering to recreate but I think we figured it out. It should be fixed by bumping the required version of posterior in 9eda8f9. If you want to try it out either of these commands should install the proper versions of everything now that I bumped the versions and tagged cmdstanr 0.2.2.

install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

or

# install.packages("remotes")
remotes::install_github("stan-dev/cmdstanr")

@bob-carpenter
Copy link
Contributor Author

bob-carpenter commented Dec 3, 2020

@bob-carpenter Can you try updating the posterior package with devtools::install_github("stan-dev/posterior") and then see if the error goes away? Sorry for the hassle.

> devtools::install_github("stan-dev/posterior")
Error in loadNamespace(name) : there is no package called ‘devtools’

Did I need to have devtools installed to install CmdStanR? I tried install.packages('devtools') which errored out with:

> install.packages('devtools')

...lots and lots of installs here...

Error: cannot remove prior installation of package ‘processx’
In addition: Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /opt/X11/lib/libSM.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/modules/R_X11.so
  Reason: image not found

> library('devtools')
Error in library("devtools") : there is no package called ‘devtools’

This is indicative of the kind of problems I have trying to follow the diagnostics. I'm not an R-dev, just a novice user.

@jgabry
Copy link
Member

jgabry commented Dec 3, 2020

Ugh yeah those diagnostics are pretty useless!

Did I need to have devtools installed to install CmdStanR?

No, that's just one option. You can also use

install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

without devtools. Maybe try this:

# terminate and restart R to make sure no packages are loaded
remove.packages(c("posterior", "cmdstanr", "processx"))

install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

@jgabry
Copy link
Member

jgabry commented Dec 3, 2020

Bob has gone back to using RStan

That's because I have a project I need to get done and couldn't get CmdStanR installed and working properly. I filed the issue because I hope to use it when I can get it installed.

Sorry I thought we had lost you ;) I know you've run into a bunch of issues that still need to be sorted out with CmdStanR.

@jgabry
Copy link
Member

jgabry commented Dec 3, 2020

I'm going to close this because the issue with summary() is fixed by 9eda8f9, but @bob-carpenter I can definitely keep trying to help troubleshoot the install trouble from #383 (comment) if it's still not working. I'm sorry it's been such a hassle!

@jgabry jgabry closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants