H2OServerError:HTTP 500服务器错误:服务器错误water.util.DistributedException:

时间:2017-06-07 23:00:50

标签: python-3.x h2o

我在将数据集加载到h2o时遇到问题。当我昨天能够运行相同的代码而没有问题时,我一直得到相同的H2o服务器错误。

import h2o
h2o.init()

h2o.import_file('train_csv')

train_csv位于同一目录中,并从火花数据帧保存在上面的行中。我继续得到同样的错误:

H2OServerError                            Traceback (most recent call last)
<ipython-input-3-d9a5a8533622> in <module>()
----> 1 h2o.import_file('train_csv')

/home/.local/lib/python3.5/site-packages/h2o/h2o.py in import_file(path, 
destination_frame, parse, header, sep, col_names, col_types, na_strings, 
pattern)
    405         return lazy_import(path, pattern)
    406     else:
--> 407         return H2OFrame()._import_parse(path, pattern, 
destination_frame, header, sep, col_names, col_types, na_strings)
    408 
    409 

/home/.local/lib/python3.5/site-packages/h2o/frame.py in _import_parse(self, 
path, pattern, destination_frame, header, separator, column_names, 
column_types, na_strings)
    306             path = os.path.abspath(path)
    307         rawkey = h2o.lazy_import(path, pattern)
--> 308         self._parse(rawkey, destination_frame, header, separator, 
column_names, column_types, na_strings)
    309         return self
    310 

/home/.local/lib/python3.5/site-packages/h2o/frame.py in _parse(self, 
rawkey, destination_frame, header, separator, column_names, column_types, 
na_strings)
    319     def _parse(self, rawkey, destination_frame="", header=None, 
separator=None, column_names=None, column_types=None,
    320                na_strings=None):
--> 321         setup = h2o.parse_setup(rawkey, destination_frame, header, 
separator, column_names, column_types, na_strings)
    322         return self._parse_raw(setup)
    323 

/home/.local/lib/python3.5/site-packages/h2o/h2o.py in 
parse_setup(raw_frames, destination_frame, header, separator, column_names, 
column_types, na_strings)
    550         kwargs["separator"] = ord(separator)
    551 
--> 552     j = api("POST /3/ParseSetup", data=kwargs)
    553     if "warnings" in j and j["warnings"]:
    554         for w in j["warnings"]:

/home/.local/lib/python3.5/site-packages/h2o/h2o.py in api(endpoint, data, 
json, filename, save_to)
     97     # type checks are performed in H2OConnection class
     98     _check_connection()
---> 99     return h2oconn.request(endpoint, data=data, json=json, 
filename=filename, save_to=save_to)
    100 
    101 

/home/.local/lib/python3.5/site-packages/h2o/backend/connection.py in 
request(self, endpoint, data, json, filename, save_to)
   400                                     auth=self._auth, 
verify=self._verify_ssl_cert, proxies=self._proxies)
    401             self._log_end_transaction(start_time, resp)
--> 402             return self._process_response(resp, save_to)
    403 
    404         except (requests.exceptions.ConnectionError, 
requests.exceptions.HTTPError) as e:

/home/.local/lib/python3.5/site-packages/h2o/backend/connection.py in 
_process_response(response, save_to)
    728         # Note that it is possible to receive valid H2OErrorV3 
object in this case, however it merely means the server
    729         # did not provide the correct status code.
--> 730         raise H2OServerError("HTTP %d %s:\n%r" % (status_code, 
response.reason, data))
    731 
    732 

H2OServerError: HTTP 500 Server Error:
Server error water.util.DistributedException:
  Error: DistributedException from /127.0.0.1:54321
  Request: None

3 个答案:

答案 0 :(得分:1)

感谢您的帮助。事实证明我的错误来自于我的train_csv因为我上面没有改变的变量而空了。它恢复了工作。

答案 1 :(得分:0)

h2o.import_file()函数需要使用文件的完整路径。更改您的代码以使用完整路径,希望这将解决问题。

答案 2 :(得分:0)

我只是遇到了这个问题,对我来说是文件没有读取权限。因此,我只需要执行chmod 777 train.csv即可获得全部特权。现在您可能不想授予它777的所有特权,我这样做是因为对我来说最简单。