H2OResponseErrorH2OResponseError:服务器错误java.lang.IllegalArgumentException:

问题描述 投票:1回答:1

嗨,我在使用H2O教程从NLP运行AmazonReviews教程时遇到此错误

http://docs.h2o.ai/h2o-tutorials/latest-stable/h2o-world-2017/nlp/index.html

当我试图跑:

# Train Word2Vec Model
from h2o.estimators.word2vec import H2OWord2vecEstimator

# This takes time to run - left commented out
#w2v_model = H2OWord2vecEstimator(vec_size = 100, model_id = "w2v.hex")
#w2v_model.train(training_frame=words)

# Pre-trained model available on s3: https://s3.amazonaws.com/tomk/h2o-world/megan/w2v.hex
w2v_model = h2o.load_model("https://s3.amazonaws.com/tomk/h2o-world/megan/w2v.hex")

我收到以下错误:

---------------------------------------------------------------------------
H2OResponseError                          Traceback (most recent call last)
<ipython-input-22-a55d2503e18d> in <module>
      7 
      8 # Pre-trained model available on s3: https://s3.amazonaws.com/tomk/h2o-world/megan/w2v.hex
----> 9 w2v_model = h2o.load_model("https://s3.amazonaws.com/tomk/h2o-world/megan/w2v.hex")

~\Anaconda3\lib\site-packages\h2o\h2o.py in load_model(path)
    989     """
    990     assert_is_type(path, str)
--> 991     res = api("POST /99/Models.bin/%s" % "", data={"dir": path})
    992     return get_model(res["models"][0]["model_id"]["name"])
    993 

~\Anaconda3\lib\site-packages\h2o\h2o.py in api(endpoint, data, json, filename, save_to)
    101     # type checks are performed in H2OConnection class
    102     _check_connection()
--> 103     return h2oconn.request(endpoint, data=data, json=json, filename=filename, save_to=save_to)
    104 
    105 

~\Anaconda3\lib\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:

~\Anaconda3\lib\site-packages\h2o\backend\connection.py in _process_response(response, save_to)
    723         # Client errors (400 = "Bad Request", 404 = "Not Found", 412 = "Precondition Failed")
    724         if status_code in {400, 404, 412} and isinstance(data, (H2OErrorV3, H2OModelBuilderErrorV3)):
--> 725             raise H2OResponseError(data)
    726 
    727         # Server errors (notably 500 = "Server Error")

H2OResponseError: Server error java.lang.IllegalArgumentException:
  Error: Cannot find persist manager for scheme https
  Request: POST /99/Models.bin/
    data: {'dir': 'https://s3.amazonaws.com/tomk/h2o-world/megan/w2v.hex'}
python nlp h2o
1个回答
0
投票

其实我觉得我弄明白了。如果您正在运行本教程,请不要尝试下载该文件。只需取消评论以下内容即可

由此 :

# This takes time to run - left commented out
#w2v_model = H2OWord2vecEstimator(vec_size = 100, model_id = "w2v.hex")
#w2v_model.train(training_frame=words)

对此:

# This takes time to run - left commented out
w2v_model = H2OWord2vecEstimator(vec_size = 100, model_id = "w2v.hex")
w2v_model.train(training_frame=words)

希望这有助于某人:)

© www.soinside.com 2019 - 2024. All rights reserved.