Error with H2O in R - can't connect to local host

回眸只為那壹抹淺笑 提交于 2019-11-27 06:51:43

问题


I can't get the h2o to work in my R. It shows the following error. Have no clue what it means. Previously it gave me an error because I didn't have Java 64 bit version. I downloaded the 64bit - restarted my pc - and started the process again and now it gives me this error.

Any suggestions?

library(h2o)

----------------------------------------------------------------------

Your next step is to start H2O:
    > h2o.init()

For H2O package documentation, ask for help:
    > ??h2o

After starting H2O, you can use the Web UI at http://localhost:54321
For more information visit http://docs.h2o.ai

----------------------------------------------------------------------


Attaching package: ‘h2o’

The following objects are masked from ‘package:stats’:

    cor, sd, var

The following objects are masked from ‘package:base’:

    %*%, %in%, &&, ||, apply, as.factor, as.numeric, colnames, colnames<-, ifelse,
    is.character, is.factor, is.numeric, log, log10, log1p, log2, round, signif, trunc

> h2o.init(nthreads = -1)

H2O is not running yet, starting it now...

Note:  In case of errors look at the following log files:
    C:\Users\ADM_MA~1\AppData\Local\Temp\RtmpygK1EJ/h2o_Adm_Mayur_started_from_r.out
    C:\Users\ADM_MA~1\AppData\Local\Temp\RtmpygK1EJ/h2o_Adm_Mayur_started_from_r.err

java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

Starting H2O JVM and connecting: ............................................................ 
[1] "localhost"
[1] 54321
[1] TRUE
[1] -1
[1] "Failed to connect to localhost port 54321: Connection refused"
[1] 127
Error in h2o.init(nthreads = -1) : 
  H2O failed to start, stopping execution.
In addition: Warning message:
running command 'curl 'http://localhost:54321'' had status 127 

Screenshot for h2o error in R


回答1:


Based on the error message and the troubleshooting we carried out in the comments, it seems that you are using a version of Java (Java 1.9) which is too new for your version of H2O.

Your 2 options seem to be:

  1. Verify that your version of H2O is up to date. If not, update it.
  2. Download a compatible version of Java, i.e. Java 1.8 (you can just use it for this 1 task rather than for everything, if you prefer)

Note that on the main documentation page of H2O v3 it says:

Java 7 or later. Note: Java 9 is not yet released and is not currently supported.

But at the same time they usually have several Beta and Alpha development branches going, so you might find one of those that works with Java 9.




回答2:


So if anyone else is facing the same issue.

My recommendation (after spending about over 10 hours trying to figure this out (worth mentioning)) is check your version of java.

If it's higher than 8 then either keep it remove it.

I removed it because I didn't want to deal with setting the JAVA Home function in R and to reduce work.

Make sure you install Java 7 or 8 but a 64 bit version. h2o doesn't work if you have 32 bit.

Then voila! Just go ahead and type install.package('h2o') in your rstudio.

I wanted to be extra careful in my final attempt of this so unloaded and uninstalled the library because I had installed it before and then installed it again and then loaded it using library(h2o) and then h20.init() worked just fine.



来源:https://stackoverflow.com/questions/46392394/error-with-h2o-in-r-cant-connect-to-local-host

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!