From b9ca0bbda6a6355d660e1aca24433841d8d640e4 Mon Sep 17 00:00:00 2001 From: ljcornel Date: Thu, 6 Oct 2022 16:22:47 +0200 Subject: [PATCH] Handle failed training jobs in notebook 007 --- notebooks/007_train_project.ipynb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/notebooks/007_train_project.ipynb b/notebooks/007_train_project.ipynb index 4ae0fd4f..b3dc6386 100644 --- a/notebooks/007_train_project.ipynb +++ b/notebooks/007_train_project.ipynb @@ -255,7 +255,16 @@ "outputs": [], "source": [ "model = model_client.get_model_for_job(job)\n", - "print(model.overview)" + "\n", + "if model is not None:\n", + " print(model.overview)\n", + "else:\n", + " print(\n", + " f\"Job '{job.name}' completed with status '{job.status.state}: \"\n", + " f\"{job.status.message}', but did not result in a trained model. Most likely \"\n", + " f\"the model training has failed, you could try restarting the training to \"\n", + " f\"see if the problem persists.\"\n", + " )" ] }, {