From 141990eed939ce66c2bed9e3894976856cb9616e Mon Sep 17 00:00:00 2001 From: bharatjetti Date: Thu, 19 Dec 2024 14:23:49 +0530 Subject: [PATCH] Updated dataset version semantic_segmentation.ipynb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Updated oxford_iiit_pets dataset version 3.x.x to 4.0.0, Screenshot 2024-12-19 at 1.38.45 PM 2. Updated tfds.load() to tfds.data_source() to load the updated version of dataset. 3. Changed train_ds.__len__().numpy() to train_ds.__len__() as train_ds object loaded from data_source api doesn't support numpy(). Screenshot 2024-12-19 at 2.08.04 PM --- docs/vision/semantic_segmentation.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/vision/semantic_segmentation.ipynb b/docs/vision/semantic_segmentation.ipynb index 76e1230ad1e..ca4ae43dbfe 100644 --- a/docs/vision/semantic_segmentation.ipynb +++ b/docs/vision/semantic_segmentation.ipynb @@ -170,8 +170,8 @@ }, "outputs": [], "source": [ - "(train_ds, val_ds, test_ds), info = tfds.load(\n", - " 'oxford_iiit_pet:3.*.*',\n", + "(train_ds, val_ds, test_ds), info = tfds.data_source(\n", + " 'oxford_iiit_pet:4.*.*',\n", " split=['train+test[:50%]', 'test[50%:80%]', 'test[80%:100%]'],\n", " with_info=True)\n", "info" @@ -465,12 +465,12 @@ "\n", "\n", "train_steps = 2000\n", - "exp_config.trainer.steps_per_loop = int(train_ds.__len__().numpy() // BATCH_SIZE)\n", + "exp_config.trainer.steps_per_loop = int(train_ds.__len__() // BATCH_SIZE)\n", "\n", "exp_config.trainer.summary_interval = exp_config.trainer.steps_per_loop # steps_per_loop = num_of_validation_examples // eval_batch_size\n", "exp_config.trainer.checkpoint_interval = exp_config.trainer.steps_per_loop\n", "exp_config.trainer.validation_interval = exp_config.trainer.steps_per_loop\n", - "exp_config.trainer.validation_steps = int(train_ds.__len__().numpy() // BATCH_SIZE) # validation_steps = num_of_validation_examples // eval_batch_size\n", + "exp_config.trainer.validation_steps = int(train_ds.__len__() // BATCH_SIZE) # validation_steps = num_of_validation_examples // eval_batch_size\n", "exp_config.trainer.train_steps = train_steps\n", "exp_config.trainer.optimizer_config.warmup.linear.warmup_steps = exp_config.trainer.steps_per_loop\n", "exp_config.trainer.optimizer_config.learning_rate.type = 'cosine'\n",