-
Notifications
You must be signed in to change notification settings - Fork 606
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
Issue saving ulam object when using cmdstanr #443
Comments
to add more context, I was previously able to save the ulam as rds, then reload it and get all results no problem. Now when I save as rds, the file is tiny when it should be quiet large. Then the issue described in the saving and reloading ulam pull request occurs. |
Here is the code I am working with: Load In Packageslibrary(readr) Cmdstanr is version 0.8.1 Here is my code: It runs fine and says all the chains are completed. Then, when it seems to be processing everything to put the ulam object into the global evironment, I get this error I haven't seen before: This is all happening on my work computer that is much more "powerful" and all the packages got updated recently. For all those much more knowledgable than I am, if this is a problem with cmdstanr, could I just reload an older version of it? |
Let me try putting my model here again since it was formatted weird above: |
As a start, you could try only loading the libraries that you actually need. You are currently loading |
Great thank you! I am able to save my outputs now. |
What is the output of |
For str(Model) i get something that looks like this for all my variables: Then if I scroll down a little bit more I get outputs that look like this: .. .. .. ..$ samples :List of 3 Only included a little bit since the output was several hundred lines long. Thank you! |
does it include this line:
|
Almost, I have: |
This suggests that your extract.samples() call expects a stanfit instead of a cstanfit. This would happen if you're on a much older version of rethinking that does not support cmdstan yet. Are you doing this on a different installation of rethinking? |
I don't know what happened, but everything works just fine now! Maybe my computer just needed a good restart. |
I run my model and everything finishes fine. So do I immediately run the stanfit <- as_cmdstan_fit(cmdstanfit$output_files()) line of code afterwards? I tried doing that and running the line of code exactly as shown, but it gives me the error "Error: object 'cmdstanfit' not found. I replaced cmdstanfit with the name of my model and it give me the error of "Error in ModelName$output_files : $ operator not defined for the s4 class."
Any help would be greatly appreciated cause this issue has been a huge set back and I've tried to understand all the coding behind the scenes but can't make any sense of it. Thank you!
Originally posted by @FishModeler in #425 (comment)
The text was updated successfully, but these errors were encountered: