java.lang.ArrayIndexOutOfBoundsException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The following assignment of my variable rnd_data... {code} rnd_data = [[1], [2], [3], [1], [4], [2], [1], [4], [5], [10], [3]] rnd_f = h2o.H2OFrame.from_python(rnd_data, destination_frame = "rnd") rnd_f075, rnd_f025 = rnd_f.split_frame(ratios = [0.75], destination_frames = ["rnd075", "rnd025"]) kmeans6 = h2o.estimators.kmeans.H2OKMeansEstimator(model_id = "rnd_kmeans_6", training_frame = rnd_f075.frame_id, validation_frame = rnd_f025.frame_id, nfolds = 2, fold_assignment = "Random", score_each_iteration = True, k = 6) kmeans6.train(training_frame = rnd_f075, validation_frame = rnd_f025) {code} results in an ArrayIndexOutOfBoundsException: {code:none} kmeans Model Build progress: | (failed) --------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-27-4067a2add74e> in <module>() ----> 1 kmeans6.train(training_frame = rnd_f075, validation_frame = rnd_f025) /opt/conda/lib/python3.5/site-packages/h2o/estimators/estimator_base.py in train(self, x, y, training_frame, offset_column, fold_column, weights_column, validation_frame, max_runtime_secs, **params) 161 parms["weights_column"] = weights_column 162 parms["max_runtime_secs"] = max_runtime_secs --> 163 self.build_model(parms) 164 165 def build_model(self, algo_params): /opt/conda/lib/python3.5/site-packages/h2o/estimators/estimator_base.py in build_model(self, algo_params) 174 if is_auto_encoder and y is not None: raise ValueError("y should not be specified for autoencoder.") 175 if not is_unsupervised and y is None: raise ValueError("Missing response") --> 176 self._model_build(x, y, training_frame, validation_frame, algo_params) 177 178 def _model_build(self, x, y, tframe, vframe, kwargs): /opt/conda/lib/python3.5/site-packages/h2o/estimators/estimator_base.py in _model_build(self, x, y, tframe, vframe, kwargs) 201 return 202 --> 203 model.poll() 204 model_json = h2o.api("GET /%d/Models/%s" % (rest_ver, model.dest_key))["models"][0] 205 self._resolve_model(model.dest_key, model_json) /opt/conda/lib/python3.5/site-packages/h2o/job.py in poll(self) 75 if (isinstance(self.job, dict)) and ("stacktrace" in list(self.job)): 76 raise EnvironmentError("Job with key {} failed with an exception: {}\nstacktrace: " ---> 77 "\n{}".format(self.job_key, self.exception, self.job["stacktrace"])) 78 else: 79 raise EnvironmentError("Job with key %s failed with an exception: %s" % (self.job_key, self.exception)) OSError: Job with key $0301ac11000332d4ffffffff$_a3c95020f0efb0e769cf63bf75024abf failed with an exception: java.lang.ArrayIndexOutOfBoundsException: 2 stacktrace: java.lang.ArrayIndexOutOfBoundsException: 2 at hex.kmeans.KMeans$KMeansDriver.createScoringHistoryTable(KMeans.java:364) at hex.kmeans.KMeans$KMeansDriver.computeStatsFillModel(KMeans.java:208) at hex.kmeans.KMeans$KMeansDriver.computeImpl(KMeans.java:281) at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169) at water.H2O$H2OCountedCompleter.compute(H2O.java:1198) at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) {code} Same error, if I cast the python list into a numpy array, i.e.: {code:python} rnd_data = np.array(rnd_data) {code} If I do this... {code:python} rnd_data = np.random.rand(30) {code} ...then the error is: {code:none} --------------------------------------------------------------------------- H2OResponseError Traceback (most recent call last) <ipython-input-37-4067a2add74e> in <module>() ----> 1 kmeans6.train(training_frame = rnd_f075, validation_frame = rnd_f025) /opt/conda/lib/python3.5/site-packages/h2o/estimators/estimator_base.py in train(self, x, y, training_frame, offset_column, fold_column, weights_column, validation_frame, max_runtime_secs, **params) 161 parms["weights_column"] = weights_column 162 parms["max_runtime_secs"] = max_runtime_secs --> 163 self.build_model(parms) 164 165 def build_model(self, algo_params): /opt/conda/lib/python3.5/site-packages/h2o/estimators/estimator_base.py in build_model(self, algo_params) 174 if is_auto_encoder and y is not None: raise ValueError("y should not be specified for autoencoder.") 175 if not is_unsupervised and y is None: raise ValueError("Missing response") --> 176 self._model_build(x, y, training_frame, validation_frame, algo_params) 177 178 def _model_build(self, x, y, tframe, vframe, kwargs): /opt/conda/lib/python3.5/site-packages/h2o/estimators/estimator_base.py in _model_build(self, x, y, tframe, vframe, kwargs) 194 rest_ver = kwargs.pop("_rest_version") if "_rest_version" in kwargs else 3 195 --> 196 model = H2OJob(h2o.api("POST /%d/ModelBuilders/%s" % (rest_ver, self.algo), data=kwargs), 197 job_type=(self.algo + " Model Build")) 198 /opt/conda/lib/python3.5/site-packages/h2o/h2o.py in api(endpoint, data, json, filename, save_to) 76 # type checks are performed in H2OConnection class 77 _check_connection() ---> 78 return h2oconn.request(endpoint, data=data, json=json, filename=filename, save_to=save_to) 79 80 /opt/conda/lib/python3.5/site-packages/h2o/backend/connection.py in request(self, endpoint, data, json, filename, save_to) 249 auth=self._auth, verify=self._verify_ssl_cert, proxies=self._proxies) 250 self._log_end_transaction(start_time, resp) --> 251 return self._process_response(resp, save_to) 252 253 except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError) as e: /opt/conda/lib/python3.5/site-packages/h2o/backend/connection.py in _process_response(response, save_to) 574 # Client errors (400 = "Bad Request", 404 = "Not Found", 412 = "Precondition Failed") 575 if status_code in {400, 404, 412} and isinstance(data, (H2OErrorV3, H2OModelBuilderErrorV3)): --> 576 raise H2OResponseError(data) 577 578 # Server errors (notably 500 = "Server Error") H2OResponseError: <h2o.schemas.error.H2OModelBuilderErrorV3 object at 0x7fd12bdc46a0> {code} But if I do as follows, then kmeans is successful: {code:python} rnd_data = np.random.rand(30,1) {code} I however think, that any one of the above assignments to rnd_data should work.
    via by Johannes,
  • pyunit_javapredict_dynamic_data_paramsKmeans.py {code} [2015-12-09 20:49:49] Connect to h2o on IP: 127.0.0.1 PORT: 57789 -------------------------- ------------------------------------- H2O cluster uptime: 5 minutes 32 seconds 175 milliseconds H2O cluster version: 3.7.0.99999 H2O cluster name: H2O_runit_jenkins_2523471 H2O cluster total nodes: 1 H2O cluster total memory: 2.72 GB H2O cluster total cores: 40 H2O cluster allowed cores: 40 H2O cluster healthy: True H2O Connection ip: 127.0.0.1 H2O Connection port: 57789 -------------------------- ------------------------------------- Dataset parameters: {'categorical_fraction': 0.9, 'rows': 9679, 'has_response': True, 'factors': 65, 'missing_fraction': 0.12726600339388394, 'cols': 20, 'integer_fraction': -0.0, 'randomize': True} Create Frame Progress: [ ] 00% Create Frame Progress: [##################################################] 100% Training dataset: response C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15 C16 C17 C18 C19 C20 ---------- ----- ----- ----- ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 0 ee7e1 d2a20 nan 697d2 85fc4 7b70d c246c 24b09 0fefc 3a01a cd8a8 0 6bb94 bdebe 0ac7e d2d6a addc8 1 1e3b1 2c587 241d3 nan 5f66f f03c4 4a8d0 8b2ab 886ac d8758 5a304 3a01a 5092f c53e2 0 fa699 41d79 e54d4 783f0 1 3ee22 0501f c6d14 0 7c439 225ba b32f9 50a83 cc92c c89f3 2c0fe 53b5b ba445 82cd1 0 c56bc ff3f3 9c042 de2cd da9c4 0 a732f bd452 2f803 nan 782af 2be7c b3170 0af14 24b09 70ec4 69d8b aac2b 7748d 47fbf 0 e3d59 3f298 d8200 da9c4 0 36ad9 bd452 e80c7 0 600d2 b68f9 4a8d0 ef422 e1e23 5dd29 f59ec 79dba 0 fce70 1ab99 6defd 5372b 098cb 0 503db 17cc7 68c52 0 10eb9 df489 3c68c 5a57e d48ad 416dd f7031 0e28f 0 9228e 9d552 b2357 105bc 53c88 0 58b1e 9c718 49bc2 0 bb89e 3342e fcc7e bb0fd 3f43d 048fd 5a304 0f726 df665 0 553b1 fb610 0ac7e 00c8a faff8 0 edbbd a86d4 a6232 0 8d33d da2a9 62cd5 cce71 367d8 d4df1 00d93 42c3b 5092f 084ec 0 3370f a0582 6defd 1132d 3a751 0 8c97b 3631a 0 530a8 f73a0 39b07 72cd5 a880e a3f47 cc54b c6f79 4cbad 0 677f6 1561c 403c5 4c9ec 1980c 1 60da4 48fb8 0 204c8 4a474 9a344 d62f2 dfce9 1d545 e55e9 f1d76 5ce81 30fb4 0 c83bc ea2cc ff721 105bc [9679 rows x 21 columns] Parameter list: {'k': 7, 'standardize': True, 'max_iterations': 754} Creating model in H2O kmeans Model Build Progress: [ ] 00% kmeans Model Build Progress: [ ] 00% kmeans Model Build Progress: [ ] 00% Traceback (most recent call last): File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/scripts/h2o-py-test-setup.py", line 144, in <module> h2o_test_setup(sys.argv) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/scripts/h2o-py-test-setup.py", line 139, in h2o_test_setup elif _IS_PYUNIT_: pyunit_utils.pyunit_exec(_TEST_NAME_) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/tests/pyunit_utils/utilsPY.py", line 283, in pyunit_exec exec pyunit_c in p File "<string>", line 55, in <module> File "<string>", line 50, in javapredict_dynamic_data File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/tests/pyunit_utils/utilsPY.py", line 142, in javapredict if algo == "kmeans" or algo == "pca": model.train(x=x, training_frame=train) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/estimators/estimator_base.py", line 108, in train self.build_model(parms) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/estimators/estimator_base.py", line 121, in build_model self._model_build(x, y, training_frame, validation_frame, algo_params) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/estimators/estimator_base.py", line 145, in _model_build model.poll() File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/job.py", line 49, in poll raise EnvironmentError("Job with key {} failed with an exception: {}".format(self.job_key, self.exception)) EnvironmentError: Job with key $0301ac11029bbee1ffffffff$_9ab840718e5029ecfd041b1d9ba24cf1 failed with an exception: Got exception 'class java.lang.ArrayIndexOutOfBoundsException', with msg '2' java.lang.ArrayIndexOutOfBoundsException: 2 at hex.kmeans.KMeans$KMeansDriver.createScoringHistoryTable(KMeans.java:398) at hex.kmeans.KMeans$KMeansDriver.computeStatsFillModel(KMeans.java:227) at hex.kmeans.KMeans$KMeansDriver.compute2(KMeans.java:301) at water.H2O$H2OCountedCompleter.compute(H2O.java:1069) at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) Sucessfully closed the H2O Session. {code}
    via by Arno Candel,
  • pyunit_javapredict_dynamic_data_paramsKmeans.py {code} [2015-12-09 20:49:49] Connect to h2o on IP: 127.0.0.1 PORT: 57789 -------------------------- ------------------------------------- H2O cluster uptime: 5 minutes 32 seconds 175 milliseconds H2O cluster version: 3.7.0.99999 H2O cluster name: H2O_runit_jenkins_2523471 H2O cluster total nodes: 1 H2O cluster total memory: 2.72 GB H2O cluster total cores: 40 H2O cluster allowed cores: 40 H2O cluster healthy: True H2O Connection ip: 127.0.0.1 H2O Connection port: 57789 -------------------------- ------------------------------------- Dataset parameters: {'categorical_fraction': 0.9, 'rows': 9679, 'has_response': True, 'factors': 65, 'missing_fraction': 0.12726600339388394, 'cols': 20, 'integer_fraction': -0.0, 'randomize': True} Create Frame Progress: [ ] 00% Create Frame Progress: [##################################################] 100% Training dataset: response C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15 C16 C17 C18 C19 C20 ---------- ----- ----- ----- ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 0 ee7e1 d2a20 nan 697d2 85fc4 7b70d c246c 24b09 0fefc 3a01a cd8a8 0 6bb94 bdebe 0ac7e d2d6a addc8 1 1e3b1 2c587 241d3 nan 5f66f f03c4 4a8d0 8b2ab 886ac d8758 5a304 3a01a 5092f c53e2 0 fa699 41d79 e54d4 783f0 1 3ee22 0501f c6d14 0 7c439 225ba b32f9 50a83 cc92c c89f3 2c0fe 53b5b ba445 82cd1 0 c56bc ff3f3 9c042 de2cd da9c4 0 a732f bd452 2f803 nan 782af 2be7c b3170 0af14 24b09 70ec4 69d8b aac2b 7748d 47fbf 0 e3d59 3f298 d8200 da9c4 0 36ad9 bd452 e80c7 0 600d2 b68f9 4a8d0 ef422 e1e23 5dd29 f59ec 79dba 0 fce70 1ab99 6defd 5372b 098cb 0 503db 17cc7 68c52 0 10eb9 df489 3c68c 5a57e d48ad 416dd f7031 0e28f 0 9228e 9d552 b2357 105bc 53c88 0 58b1e 9c718 49bc2 0 bb89e 3342e fcc7e bb0fd 3f43d 048fd 5a304 0f726 df665 0 553b1 fb610 0ac7e 00c8a faff8 0 edbbd a86d4 a6232 0 8d33d da2a9 62cd5 cce71 367d8 d4df1 00d93 42c3b 5092f 084ec 0 3370f a0582 6defd 1132d 3a751 0 8c97b 3631a 0 530a8 f73a0 39b07 72cd5 a880e a3f47 cc54b c6f79 4cbad 0 677f6 1561c 403c5 4c9ec 1980c 1 60da4 48fb8 0 204c8 4a474 9a344 d62f2 dfce9 1d545 e55e9 f1d76 5ce81 30fb4 0 c83bc ea2cc ff721 105bc [9679 rows x 21 columns] Parameter list: {'k': 7, 'standardize': True, 'max_iterations': 754} Creating model in H2O kmeans Model Build Progress: [ ] 00% kmeans Model Build Progress: [ ] 00% kmeans Model Build Progress: [ ] 00% Traceback (most recent call last): File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/scripts/h2o-py-test-setup.py", line 144, in <module> h2o_test_setup(sys.argv) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/scripts/h2o-py-test-setup.py", line 139, in h2o_test_setup elif _IS_PYUNIT_: pyunit_utils.pyunit_exec(_TEST_NAME_) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/tests/pyunit_utils/utilsPY.py", line 283, in pyunit_exec exec pyunit_c in p File "<string>", line 55, in <module> File "<string>", line 50, in javapredict_dynamic_data File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/tests/pyunit_utils/utilsPY.py", line 142, in javapredict if algo == "kmeans" or algo == "pca": model.train(x=x, training_frame=train) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/estimators/estimator_base.py", line 108, in train self.build_model(parms) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/estimators/estimator_base.py", line 121, in build_model self._model_build(x, y, training_frame, validation_frame, algo_params) File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/estimators/estimator_base.py", line 145, in _model_build model.poll() File "/home4/jenkins/slave_dir_from_mr-0xa1/workspace/arno_pyunit_small/h2o-py/h2o/job.py", line 49, in poll raise EnvironmentError("Job with key {} failed with an exception: {}".format(self.job_key, self.exception)) EnvironmentError: Job with key $0301ac11029bbee1ffffffff$_9ab840718e5029ecfd041b1d9ba24cf1 failed with an exception: Got exception 'class java.lang.ArrayIndexOutOfBoundsException', with msg '2' java.lang.ArrayIndexOutOfBoundsException: 2 at hex.kmeans.KMeans$KMeansDriver.createScoringHistoryTable(KMeans.java:398) at hex.kmeans.KMeans$KMeansDriver.computeStatsFillModel(KMeans.java:227) at hex.kmeans.KMeans$KMeansDriver.compute2(KMeans.java:301) at water.H2O$H2OCountedCompleter.compute(H2O.java:1069) at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) Sucessfully closed the H2O Session. {code}
    via by Arno Candel,
    • java.lang.ArrayIndexOutOfBoundsException: 2 at hex.kmeans.KMeans$KMeansDriver.createScoringHistoryTable(KMeans.java:364) at hex.kmeans.KMeans$KMeansDriver.computeStatsFillModel(KMeans.java:208) at hex.kmeans.KMeans$KMeansDriver.computeImpl(KMeans.java:281) at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169) at water.H2O$H2OCountedCompleter.compute(H2O.java:1198) at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
    No Bugmate found.