Ruben Cruywagen
Ruben Cruywagen

Reputation: 1

Job fail while attempting to train a model with scikit-learn on Google Cloud AI Platform

Using the tutorial by Google I manage to successfully submit the training application through Cloud Shell but the job fails soon after.

I've tried using a blank .py file, just to try see if that was causing the issue, but I get the exact same error message.

After setting the ENV variables as shown in the tutorial I run the following command:

gcloud ai-platform jobs submit training $JOB_NAME \
  --job-dir $JOB_DIR \
  --package-path $TRAINING_PACKAGE_PATH \
  --module-name $MAIN_TRAINER_MODULE \
  --region $REGION \
  --runtime-version=$RUNTIME_VERSION \
  --python-version=$PYTHON_VERSION \
  --scale-tier $SCALE_TIER

The job submits successfully:

Job [sklearn_training_20190823_131024] submitted successfully.
Your job is still active. You may view the status of your job with the command

  $ gcloud ai-platform jobs describe sklearn_training_20190823_131024

or continue streaming the logs with the command

After running the command to stream the logs I get the following error message:

Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main mod_name, _Error) File "/usr/lib/python2.7/runpy.py", line 119, in _get_module_details code = loader.get_code(mod_name) File "/usr/lib/python2.7/pkgutil.py", line 283, in get_code self.code = compile(source, self.filename, 'exec') File "/root/.local/lib/python2.7/site-packages/scikit_training3/trial.py", line 1 Not Found ^ SyntaxError: invalid syntax

Upvotes: 0

Views: 75

Answers (1)

Ruben Cruywagen
Ruben Cruywagen

Reputation: 1

I managed to fix the issue: the problem was that the '''curl''' command to get the training .py file from GitHub (as shown in the tutorial) did not actually download the file. Instead I used the '''git clone''' command.

Upvotes: 0

Related Questions