Skip to content

Commit a81ea51

Browse files
Merge pull request #2200 from jhhan0:master
PiperOrigin-RevId: 518323997
2 parents ced323b + 9e2b9ae commit a81ea51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

site/en/tutorials/images/segmentation.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
"\n",
453453
"Now, all that is left to do is to compile and train the model. \n",
454454
"\n",
455-
"Since this is a multiclass classification problem, use the `tf.keras.losses.CategoricalCrossentropy` loss function with the `from_logits` argument set to `True`, since the labels are scalar integers instead of vectors of scores for each pixel of every class.\n",
455+
"Since this is a multiclass classification problem, use the `tf.keras.losses.SparseCategoricalCrossentropy` loss function with the `from_logits` argument set to `True`, since the labels are scalar integers instead of vectors of scores for each pixel of every class.\n",
456456
"\n",
457457
"When running inference, the label assigned to the pixel is the channel with the highest value. This is what the `create_mask` function is doing."
458458
]
@@ -710,7 +710,7 @@
710710
"id": "Gbwo3DZ-9TxM"
711711
},
712712
"source": [
713-
"So, to make sample weights for this tutorial, you need a function that takes a `(data, label)` pair and returns a `(data, label, sample_weight)` triple. Where the `sample_weight` is a 1-channel image containing the class weight for each pixel.\n",
713+
"So, to make sample weights for this tutorial, you need a function that takes a `(data, label)` pair and returns a `(data, label, sample_weight)` triple where the `sample_weight` is a 1-channel image containing the class weight for each pixel.\n",
714714
"\n",
715715
"The simplest possible implementation is to use the label as an index into a `class_weight` list:"
716716
]
@@ -804,7 +804,7 @@
804804
"\n",
805805
"Now that you have an understanding of what image segmentation is and how it works, you can try this tutorial out with different intermediate layer outputs, or even different pretrained models. You may also challenge yourself by trying out the [Carvana](https://www.kaggle.com/c/carvana-image-masking-challenge/overview) image masking challenge hosted on Kaggle.\n",
806806
"\n",
807-
"You may also want to see the [Tensorflow Object Detection API](https://github.com/tensorflow/models/blob/master/research/object_detection/README.md) for another model you can retrain on your own data. Pretrained models are available on [TensorFlow Hub](https://www.tensorflow.org/hub/tutorials/tf2_object_detection#optional)"
807+
"You may also want to see the [Tensorflow Object Detection API](https://github.com/tensorflow/models/blob/master/research/object_detection/README.md) for another model you can retrain on your own data. Pretrained models are available on [TensorFlow Hub](https://www.tensorflow.org/hub/tutorials/tf2_object_detection#optional)."
808808
]
809809
}
810810
],

0 commit comments

Comments
 (0)