Suppress error when trying to cancel job that's already compelted
"! gsutil -m rm -r $JOB_DIR\n",
"\n",
"# If the training job is still running, cancel it\n",
- "! gcloud ml-engine jobs cancel $JOB_NAME --quiet"
+ "! gcloud ml-engine jobs cancel $JOB_NAME --quiet --verbosity critical"
],
"execution_count": 39,
"outputs": [
"Removing gs://<your-bucket-name>/keras-job-dir/keras_export/1553710379/variables/variables.index#1553710392464814...\n",
"Removing gs://<your-bucket-name>/keras-job-dir/packages/dcc159f40836cff74a27866227b327b0a8ccb5266194e76cff5368266b6d1cdd/trainer-0.0.0.tar.gz#1553709266664674...\n",
"/ [18/18 objects] 100% Done \n",
- "Operation completed over 18 objects. \n",
- "\u001b[1;31mERROR:\u001b[0m (gcloud.ml-engine.jobs.cancel) FAILED_PRECONDITION: Field: name Error: Cannot cancel an already completed job.\n",
- "- '@type': type.googleapis.com/google.rpc.BadRequest\n",
- " fieldViolations:\n",
- " - description: Cannot cancel an already completed job.\n",
- " field: name\n"
+ "Operation completed over 18 objects. \n"
],
"name": "stdout"
}
