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

output duplicated when running diagnose #826

Closed
ksvanhorn opened this issue Aug 19, 2023 · 1 comment · Fixed by #834
Closed

output duplicated when running diagnose #826

ksvanhorn opened this issue Aug 19, 2023 · 1 comment · Fixed by #834
Labels
bug Something isn't working

Comments

@ksvanhorn
Copy link

Describe the bug
In the file R/run.R, near the end of the function .run_diagnose, are these lines, which get called if the diagnose operation fails:

if (file.exists(stdout_file)) {
      cat(readLines(stdout_file), sep = "\n")
    }
    if (file.exists(stdout_file)) {
      cat(readLines(stdout_file), sep = "\n")
    }

Expected behavior
There's no point in printing the output twice, so I suspect that one of those is supposed to be stderrr.

Other notes
I encountered this because model$diagnose(data=data_file) failed for me, and most of the output scrolled off the top of my console window, making it inaccessible. In particular, the initial part of the output, with all the information about the program options and the column headings, is not visible. I had to run the debugger and step through execution to get the info I wanted. I think there ought to be a better way of presenting this information to the user.

It's worth noting the the columns in the output aren't documented anywhere that I can find. I can guess what some of them are, but what are "param idx" and "value"?

One other note: it seems that the diagnose operation failed with a return code of 1, but none of the information I was able to gather told me why the program failed. I'm guessing that maybe an exception got thrown while evaluating an extremely large gradient, but it would be useful for the program to say more instead of just returning an error code of 1.

@ksvanhorn ksvanhorn added the bug Something isn't working label Aug 19, 2023
@jgabry
Copy link
Member

jgabry commented Aug 23, 2023

Yeah I think one of those stdout_files should be stderr_file. Regarding the lack of documentation of the columns and the lack of additional information, I agree but I think those are CmdStan issues, so I'll open a separate issue there and close this one once we fix the duplicate stdout_file.

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

Successfully merging a pull request may close this issue.

2 participants