java.lang.NullPointerException

JIRA | Johannes | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Running kmeans with fold_assignment = "Stratified" parameter fails: {code:python} rnd_data = np.random.rand(30,2) 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 = "Stratified", score_each_iteration = True, k = 6) kmeans6.train(training_frame = rnd_f075, validation_frame = rnd_f025) {code} results in {code:none} kmeans Model Build progress: | (failed) --------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-16-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$_a84c1d743edfb29b6940d240c8a4164 failed with an exception: java.lang.NullPointerException stacktrace: java.lang.NullPointerException at water.rapids.ast.prims.advmath.AstKFold.stratifiedKFoldColumn(AstKFold.java:62) at hex.ModelBuilder.cv_AssignFold(ModelBuilder.java:310) at hex.ModelBuilder.computeCrossValidation(ModelBuilder.java:257) at hex.ModelBuilder$1.compute2(ModelBuilder.java:200) 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}

    JIRA | 6 months ago | Johannes
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at water.rapids.ast.prims.advmath.AstKFold.stratifiedKFoldColumn()
    2. water.rapids.ast
      AstKFold.stratifiedKFoldColumn
      1. water.rapids.ast.prims.advmath.AstKFold.stratifiedKFoldColumn(AstKFold.java:62)
      1 frame
    3. hex
      ModelBuilder$1.compute2
      1. hex.ModelBuilder.cv_AssignFold(ModelBuilder.java:310)
      2. hex.ModelBuilder.computeCrossValidation(ModelBuilder.java:257)
      3. hex.ModelBuilder$1.compute2(ModelBuilder.java:200)
      3 frames
    4. water
      H2O$H2OCountedCompleter.compute
      1. water.H2O$H2OCountedCompleter.compute(H2O.java:1198)
      1 frame
    5. jsr166y
      ForkJoinWorkerThread.run
      1. jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
      2. jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
      3. jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
      4. jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
      5. jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
      5 frames