From ed70718fffb837fb669b2d9fdf61809f6b1fb640 Mon Sep 17 00:00:00 2001 From: Boris Feld Date: Tue, 9 Jul 2024 17:39:11 +0200 Subject: [PATCH] Fix metaflow and tensorflow/tensorboard examples --- .../notebooks/Comet_and_Tensorflow.ipynb | 16 ++++++++-------- .../metaflow-model-evaluation.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/integrations/model-training/tensorflow/notebooks/Comet_and_Tensorflow.ipynb b/integrations/model-training/tensorflow/notebooks/Comet_and_Tensorflow.ipynb index ccc8918..7803e2e 100644 --- a/integrations/model-training/tensorflow/notebooks/Comet_and_Tensorflow.ipynb +++ b/integrations/model-training/tensorflow/notebooks/Comet_and_Tensorflow.ipynb @@ -26,7 +26,7 @@ }, "outputs": [], "source": [ - "%pip install -U \"comet_ml>=3.44.0\" tensorflow tensorflow-datasets" + "%pip install -U \"comet_ml>=3.44.0\" tensorflow \"keras>=3.0.0\" tensorflow-datasets" ] }, { @@ -48,7 +48,7 @@ "source": [ "import comet_ml\n", "\n", - "comet_ml.login(project_name=\"comet-example-tensorboard\")" + "comet_ml.login(project_name=\"comet-example-tensorboard-gradient-tape-notebook\")" ] }, { @@ -280,10 +280,10 @@ "\n", "for epoch in range(EPOCHS):\n", " # Reset the metrics at the start of the next epoch\n", - " train_loss.reset_states()\n", - " train_accuracy.reset_states()\n", - " test_loss.reset_states()\n", - " test_accuracy.reset_states()\n", + " train_loss.reset_state()\n", + " train_accuracy.reset_state()\n", + " test_loss.reset_state()\n", + " test_accuracy.reset_state()\n", "\n", " for images, labels in train_ds:\n", " train_step(images, labels)\n", @@ -346,9 +346,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.10.12" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/integrations/workflow-orchestration/metaflow/metaflow-model-evaluation/metaflow-model-evaluation.py b/integrations/workflow-orchestration/metaflow/metaflow-model-evaluation/metaflow-model-evaluation.py index 5ef6933..266fecb 100644 --- a/integrations/workflow-orchestration/metaflow/metaflow-model-evaluation/metaflow-model-evaluation.py +++ b/integrations/workflow-orchestration/metaflow/metaflow-model-evaluation/metaflow-model-evaluation.py @@ -215,7 +215,7 @@ def evaluate_classification_metrics(self): ) accuracy = accuracy_score(labels, torch.argmax(predictions, dim=1)) - self.comet_experiment.log_metrics(clf_metrics) + self.comet_experiment.log_metrics({"evaluation_by_class": clf_metrics}) self.comet_experiment.log_metrics({"accuracy": accuracy}) log_model(self.comet_experiment, model, self.input)