我在Windows 10上初始化h2o实例时遇到了麻烦。如上所述,我已经从站点安装了H2o程序包,当我尝试启动它时,它引发了服务器错误。
这是因为Java版本吗?我在下面的线程中看到了它,但不确定如何解决此问题。
unable to init h2o. can somebody help me with it
Java version:
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
代码:
import h2o
from h2o.estimators import H2ORandomForestEstimator
h2o.init()
错误:
Checking whether there is an H2O instance running at http://localhost:54321..... not found.
Attempting to start a local H2O server...
; Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Starting server from C:\ProgramData\Anaconda3\lib\site-packages\h2o\backend\bin\h2o.jar
Ice root: C:\Users\Vishnu\AppData\Local\Temp\tmp_aow9b1v
JVM stdout: C:\Users\Vishnu\AppData\Local\Temp\tmp_aow9b1v\h2o_Vishnu_started_from_python.out
JVM stderr: C:\Users\Vishnu\AppData\Local\Temp\tmp_aow9b1v\h2o_Vishnu_started_from_python.err
---------------------------------------------------------------------------
H2OConnectionError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\h2o\h2o.py in init(url, ip, port, https, insecure, username, password, cookies, proxy, start_h2o, nthreads, ice_root, enable_assertions, max_mem_size, min_mem_size, strict_version_check, ignore_config, extra_classpath, **kwargs)
251 _msgs=("Checking whether there is an H2O instance running at {url}",
--> 252 "connected.", "not found."))
253 except H2OConnectionError:
C:\ProgramData\Anaconda3\lib\site-packages\h2o\backend\connection.py in open(server, url, ip, port, https, auth, verify_ssl_certificates, proxy, cookies, verbose, _msgs)
317 conn._timeout = 3.0
--> 318 conn._cluster = conn._test_connection(retries, messages=_msgs)
319 # If a server is unable to respond within 1s, it should be considered a bug. However we disable this
C:\ProgramData\Anaconda3\lib\site-packages\h2o\backend\connection.py in _test_connection(self, max_retries, messages)
587 raise H2OConnectionError("Could not establish link to the H2O cloud %s after %d retries\n%s"
--> 588 % (self._base_url, max_retries, "\n".join(errors)))
589
H2OConnectionError: Could not establish link to the H2O cloud http://localhost:54321 after 5 retries
[36:42.92] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D89F4B7D68>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))
[36:45.13] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D89F992630>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))
[36:47.36] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D89F998A58>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))
[36:49.59] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D89F998470>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))
[36:51.81] H2OConnectionError: Unexpected HTTP error: HTTPConnectionPool(host='localhost', port=54321): Max retries exceeded with url: /3/Cloud (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001D89F99C5C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))
During handling of the above exception, another exception occurred:
H2OServerError Traceback (most recent call last)
<ipython-input-242-b49bc959c8ab> in <module>()
1 import h2o
2 from h2o.estimators import H2ORandomForestEstimator
----> 3 h2o.init()
C:\ProgramData\Anaconda3\lib\site-packages\h2o\h2o.py in init(url, ip, port, https, insecure, username, password, cookies, proxy, start_h2o, nthreads, ice_root, enable_assertions, max_mem_size, min_mem_size, strict_version_check, ignore_config, extra_classpath, **kwargs)
259 raise H2OConnectionError('Can only start H2O launcher if IP address is localhost.')
260 hs = H2OLocalServer.start(nthreads=nthreads, enable_assertions=enable_assertions, max_mem_size=mmax,
--> 261 min_mem_size=mmin, ice_root=ice_root, port=port, extra_classpath=extra_classpath)
262 h2oconn = H2OConnection.open(server=hs, https=https, verify_ssl_certificates=not insecure,
263 auth=auth, proxy=proxy,cookies=cookies, verbose=True)
C:\ProgramData\Anaconda3\lib\site-packages\h2o\backend\server.py in start(jar_path, nthreads, enable_assertions, max_mem_size, min_mem_size, ice_root, port, extra_classpath, verbose)
119 if verbose: print("Attempting to start a local H2O server...")
120 hs._launch_server(port=port, baseport=baseport, nthreads=int(nthreads), ea=enable_assertions,
--> 121 mmax=max_mem_size, mmin=min_mem_size)
122 if verbose: print(" Server is running at %s://%s:%d" % (hs.scheme, hs.ip, hs.port))
123 atexit.register(lambda: hs.shutdown())
C:\ProgramData\Anaconda3\lib\site-packages\h2o\backend\server.py in _launch_server(self, port, baseport, mmax, mmin, ea, nthreads)
315 while True:
316 if proc.poll() is not None:
--> 317 raise H2OServerError("Server process terminated with error code %d" % proc.returncode)
318 ret = self._get_server_info_from_logs()
319 if ret:
H2OServerError: Server process terminated with error code 1