[R] Rstudio crashed when I try to train a nnet model.

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon Mar 22 14:16:22 CET 2021


On 22/03/2021 8:39 a.m., Jiefei Wang wrote:
> Hi Baki,
> 
> The crash is very likely due to the bug in nnet. If this is the case, there
> is almost nothing you can do. I think you only need to wait for the
> response from the package maintainer. You can send your data to the
> maintainer and help them to debug the issue.

"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

> 
> Best,
> Jiefei
> 
> On Mon, Mar 22, 2021 at 8:20 PM Baki UNAL <bakiunal using yahoo.com> wrote:
> 
>> Hi,
>>
>> I tried to run the code in another computer in RGui. This time program run
>> until final iteration. But after the last iteration RGui quit without any
>> error code. I mailed this issue to Brian Ripley who is the maintainer of
>> R nnet package. What can I do to solve this problem?
>>
>> Best regards
>> Baki
>>
>> On Monday, March 22, 2021, 06:55:00 AM GMT+3, Jiefei Wang <
>> szwjf08 using gmail.com> wrote:
>>
>>
>> Hi Baki,
>>
>> This should be a different issue. It looks like there is no problem in the
>> R terminal. Does the crash happen every time when you run the code in
>> RStudio? If so, this should be a bug in RStudio and you need to consult
>> RStudio's mailing list as R and RStudio are maintained by different teams.
>>
>> Best,
>> Jiefei
>>
>> On Mon, Mar 22, 2021 at 12:57 AM Baki UNAL <bakiunal using yahoo.com> wrote:
>>
>> Hi Jiefei
>>
>> I run the code below in RGui
>>
>>> nn2 <- nnet(TQ~.,data = train, size=c(15,15), linout=T, MaxNWts =4000,
>> maxit=2000)
>>
>> But I got the following output:
>>
>> # weights:  435
>> initial  value 55650.887782
>> final  value 55650.887782
>> converged
>>
>> Program early converged. Program didn't any calculations.
>>
>> Best,
>> Baki
>>
>> On Sunday, March 21, 2021, 07:35:31 PM GMT+3, Jiefei Wang <
>> szwjf08 using gmail.com> wrote:
>>
>>
>> Hi Baki,
>>
>> Perhaps out of memory? Would you be able to run your code through the R
>> terminal? It probably can give us more information to debug the issue.
>>
>> Best,
>> Jiefei
>>
>> On Mon, Mar 22, 2021 at 12:23 AM Baki UNAL via R-help <
>> r-help using r-project.org> wrote:
>>
>> Hi,
>> I tried to train a neural network with following code:
>> nn2 <- nnet(TQ~.,data = train, size=c(15,15), linout=T, MaxNWts =4000,
>> maxit=2000)
>>
>> When I executed the code R studio crashed with following error:
>> "R Session Aborted
>> R encountered a fatal error.
>> The session was terminated.
>> Start new session"
>> When I set the hidden layer as c(15) as below the code works fine.
>> nn2 <- nnet(TQ~.,data = train, size=c(15), linout=T, MaxNWts =4000,
>> maxit=2000)
>>
>> What could be the problem?
>>
>> Best regards.
>>
>>
>>          [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list