简体   繁体   中英

H2OResponseErrorH2OResponseError: Server error java.lang.IllegalArgumentException:

Hi I'm getting this error when running the AmazonReviews tutorial from NLP with H2O Tutorial

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

when I try to run :

# 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")

I get the following error :

---------------------------------------------------------------------------
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'}

Actually I think I figured it out. In case you're running this tutorial don't try to download the file. Just un-comment the following lines

from this :

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

to this :

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

Hope this helps someone out :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM