cloudml-samples icon indicating copy to clipboard operation
cloudml-samples copied to clipboard

Movielens cloud run model training error with matrix factorization

Open benlam62 opened this issue 8 years ago • 5 comments

When I tried the Movielens sample, the cloud run model training job failed with matrix factorization. The pre-processing step can be run successfully.

The log message is captured as below:

Hyperparameter Tuning Trial #1 Failed before any other successful trials were completed. The failed trial had parameters: learning_rate=0.20949118997690069, . The trial's error message was: The replica master 0 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): [...] return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 666, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 856, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1078, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1063, in run_setup run_setup(setup_script, args) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 68, in run_setup DirectorySandbox(setup_dir).run(runner) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 114, in run return func() File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 67, in runner _execfile(setup_script, ns) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 43, in _execfile exec(code, globals, locals) File "/tmp/easy_install-kiZ27t/setuptools-40.4.1/setup.py", line 194, in <module> File "/usr/lib/python2.7/distutils/core.py", line 111, in setup _setup_distribution = dist = klass(attrs) File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 266, in __init__ _Distribution.__init__(self,attrs) File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__ self.finalize_options() File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 301, in finalize_options ep.load()(self, ep.name, value) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2195, in load raise ImportError("%r has no %r attribute" % (entry, attr)) ImportError: <module 'setuptools.dist' from '/usr/lib/python2.7/dist-packages/setuptools/dist.pyc'> has no 'check_specifier' attribute To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=21100138813&resource=ml_job%2Fjob_id%2Fmovielens_factorization_20180920_162902&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22movielens_factorization_20180920_162902%22

To Reproduce

The training input is:

{
  "scaleTier": "CUSTOM",
  "masterType": "standard_gpu",
  "packageUris": [
    "gs://ben-lam-project-1-ml/movielens_factorization_20180920_162902/aa659c246aec14c8fdfe4890b48a83f5c5d2fac87f45a129bf20c40e061967b8/movielens-1.0.tar.gz"
  ],
  "pythonModule": "trainer.task",
  "args": [
    "--raw_metadata_path",
    "gs://ben-lam-project-1-ml/benlam/movielens/movielens_20180920_124737/raw_metadata",
    "--transform_savedmodel",
    "gs://ben-lam-project-1-ml/benlam/movielens/movielens_20180920_124737/transform_fn",
    "--eval_data_paths",
    "gs://ben-lam-project-1-ml/benlam/movielens/movielens_20180920_124737/features_eval*.tfrecord.gz",
    "--train_data_paths",
    "gs://ben-lam-project-1-ml/benlam/movielens/movielens_20180920_124737/features_train*.tfrecord.gz",
    "--output_path",
    "gs://ben-lam-project-1-ml/benlam/movielens/model/movielens_factorization_20180920_162902",
    "--model_type",
    "matrix_factorization",
    "--eval_type",
    "ranking",
    "--l2_weight_decay",
    "0.01",
    "--learning_rate",
    "0.05",
    "--train_steps",
    "500000",
    "--eval_steps",
    "500",
    "--movie_embedding_dim",
    "64",
    "--top_k_infer",
    "100"
  ],
  "hyperparameters": {
    "goal": "MAXIMIZE",
    "params": [
      {
        "parameterName": "learning_rate",
        "minValue": 0.001,
        "maxValue": 0.3,
        "type": "DOUBLE",
        "scaleType": "UNIT_LOG_SCALE"
      }
    ],
    "maxTrials": 10,
    "maxParallelTrials": 5,
    "hyperparameterMetricTag": "recall_at_10"
  },
  "region": "us-central1"
}

benlam62 avatar Sep 27 '18 08:09 benlam62

Thanks for reporting the issue. Please allow us some time to look into it and get back to you. In the meantime, if you make any progress in resolving the issue, please provide an update.

happyhuman avatar Sep 27 '18 16:09 happyhuman

@benlam62 did you change versions in setup.py?

puneith avatar Oct 13 '18 05:10 puneith

I have the same error.

lesterlitch avatar Oct 17 '18 22:10 lesterlitch

No, I didn't change versions

benlam62 avatar Oct 24 '18 06:10 benlam62

We have deprecated this sample, I will go ahead and close this PR.

gogasca avatar May 21 '19 05:05 gogasca