H2O AI : Unsupported MOJO model 'word2vec'

Viewed 139

I have 3 h2o models:

$ ls dataset/mojo
1. DeepLearning_model_python_1582176092021_2.zip
2. StackedEnsemble_BestOfFamily_AutoML_20200220_073620.zip
3. Word2Vec_model_python_1582176092021_1.zip

The binary models for these 3 were generated on v3.28.0.3, but I am trying to upgrade the h2o version and productionize it onto v3.30.0.5 So i converted those 3 binaries successfully to MOJO models (as listed above)

When trying to upload these mojo models using the h2o.upload_mojo, for Word2Vec alone, am getting the error:


In [15]: w2v_path = 'dataset/mojo/Word2Vec_model_python_1582176092021_1.zip'

In [16]: w2v_model = h2o.upload_mojo(w2v_path)
generic Model Build progress: | (failed)                                                      |   0%
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-16-734005ed70a8> in <module>
----> 1 w2v_model = h2o.upload_mojo(w2v_path)

~/.envs/h2o-test/lib/python3.8/site-packages/h2o/h2o.py in upload_mojo(mojo_path)
   2149     frame_key = response["destination_frame"]
   2150     mojo_estimator = H2OGenericEstimator(model_key = get_frame(frame_key))
-> 2151     mojo_estimator.train()
   2152     print(mojo_estimator)
   2153     return mojo_estimator

~/.envs/h2o-test/lib/python3.8/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, ignored_columns, model_id, verbose)
    113                                  validation_frame=validation_frame, max_runtime_secs=max_runtime_secs,
    114                                  ignored_columns=ignored_columns, model_id=model_id, verbose=verbose)
--> 115         self._train(parms, verbose=verbose)
    116
    117     def train_segments(self, x=None, y=None, training_frame=None, offset_column=None, fold_column=None,

~/.envs/h2o-test/lib/python3.8/site-packages/h2o/estimators/estimator_base.py in _train(self, parms, verbose)
    205             return
    206
--> 207         job.poll(poll_updates=self._print_model_scoring_history if verbose else None)
    208         model_json = h2o.api("GET /%d/Models/%s" % (rest_ver, job.dest_key))["models"][0]
    209         self._resolve_model(job.dest_key, model_json)

~/.envs/h2o-test/lib/python3.8/site-packages/h2o/job.py in poll(self, poll_updates)
     75         if self.status == "FAILED":
     76             if (isinstance(self.job, dict)) and ("stacktrace" in list(self.job)):
---> 77                 raise EnvironmentError("Job with key {} failed with an exception: {}\nstacktrace: "
     78                                        "\n{}".format(self.job_key, self.exception, self.job["stacktrace"]))
     79             else:

OSError: Job with key $03010a64051932d4ffffffff$_8d0c64127137bd1eef16202889cf4fca failed with an exception: java.lang.IllegalArgumentException: Unsupported MOJO model 'word2vec'.
stacktrace:
java.lang.IllegalArgumentException: Unsupported MOJO model 'word2vec'.
  at hex.generic.Generic$MojoDelegatingModelDriver.computeImpl(Generic.java:99)
  at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:248)
  at hex.generic.Generic$MojoDelegatingModelDriver.compute2(Generic.java:78)
  at water.H2O$H2OCountedCompleter.compute(H2O.java:1557)
  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)

The other two models succeed without any issues, and returns a valid model_id. Any idea what the issue here is, coz from docs its understood that all three model types are supported by MOJO

I tried this with a cluster of 2 pods on K8s with 2Gi/1cpu memory each, but results in same outcome as above.

1 Answers

Word2Vec is not currently in the list of allowed algos to import back into H2O.

The documentation is a little bit confusing and needs improvement. MOJO is a way to take H2O models into production. Those are usable outside of H2O using H2O's genmodel. Some of those MOJOs are importable back into H2O and inspected. But not all of them. The first two algorithms listed are supported. Unfortunately, Word2Vec is not.

I've created a JIRA to track this issue. We should be able to enable at least scoring.

Related