Skip to content
Prev 387552 / 398502 Next

Rstudio crashed when I try to train a nnet model.

On 22/03/2021 8:39 a.m., Jiefei Wang wrote:
"Almost nothing"?  Helping to debug the problem would almost certainly 
be a welcome contribution.  If you can reproduce it while running under 
a debugger that would locate the issue, and then Prof Ripley would 
probably be able to fix it easily.

How to do that?  It's a bit easier on other systems than on Windows, but 
it's not very hard in either place.  The steps are:

  Figure out which debugger works on your system.  On macOS, it's lldb; 
I think other systems use gdb (but check the Admin manual, as I could be 
wrong).  macOS also needs a special build of R to allow debugging; see 
the "R for Mac OS X FAQ" question 10.17 for details on how to get it.

  Make sure nnet is built with debugging info.  This is automatic on 
non-Windows systems.  On Windows, reinstall it from source using R command

    install.packages("nnet", type = "source", INSTALL_opts = "--debug")

Run R under the debugger.  On Unix-alikes you start it using

   R -d lldb

or

   R -d gdb

depending on which debugger you're using.  On Windows, I think it's 
usually easiest to start R normally, then start the debugger separately 
and attach it to the R process; if you can't figure out how to do that, 
ask and someone will tell you the details, which I forget.

If R is not running, type "run" in the debugger to start it, and go 
through the process to trigger the crash.  The debugger will print very 
useful information at that point, which will likely suggest exactly what 
went wrong.  Post that here, or send it to Prof Ripley.

Duncan Murdoch