# Does the cifar100 dataset of pytorch provide coarse labels?

**URL:** <https://discuss.pytorch.org/t/does-the-cifar100-dataset-of-pytorch-provide-coarse-labels/10858>\
**Category:** Uncategorized\
**Created:** [December 6, 2017, 4:55pm UTC](https://discuss.pytorch.org/t/does-the-cifar100-dataset-of-pytorch-provide-coarse-labels/10858 "2017-12-06T16:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaodongww](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/xiaodongww/32/3026_2.png) [@xiaodongww](https://discuss.pytorch.org/u/xiaodongww)\
**Post date:** [December 6, 2017, 4:55pm UTC](https://discuss.pytorch.org/t/does-the-cifar100-dataset-of-pytorch-provide-coarse-labels/10858/1 "2017-12-06T16:55:25Z")

</div>

A quick question here about cifar100

I am wondering if the cifar100 dataset of pytorch provide a way to get the coarse labels or if there is 3rd implemented codes to realize this.

I have refered to the manual of _torchvision.datasets.CIFAR100_, there seems to be no description about coarse labels.

Thanks in advance

----------------update-------------------  
No such option in torchvision.datasets.CIFAR100  
Solved by adding an option parameter to the code of [https://github.com/pytorch/vision/blob/master/torchvision/datasets/cifar.py](https://github.com/pytorch/vision/blob/master/torchvision/datasets/cifar.py)  
See the modified code at [https://github.com/xiaodongww/pytorch/blob/master/cifarDataset.py](https://github.com/xiaodongww/pytorch/blob/master/cifarDataset.py)

---

<div class="post-metadata">

**Author:** ![SimonW](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/simonw/32/1702_2.png) [@SimonW](https://discuss.pytorch.org/u/SimonW)\
**Post date:** [December 6, 2017, 5:25pm UTC](https://discuss.pytorch.org/t/does-the-cifar100-dataset-of-pytorch-provide-coarse-labels/10858/2 "2017-12-06T17:25:22Z")

</div>

I’m not sure, but it should be easy to implement a map from [https://www.cs.toronto.edu/~kriz/cifar.html](https://www.cs.toronto.edu/~kriz/cifar.html).

---

<div class="post-metadata">

**Author:** ![xiaodongww](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/xiaodongww/32/3026_2.png) [@xiaodongww](https://discuss.pytorch.org/u/xiaodongww)\
**Post date:** [December 6, 2017, 5:49pm UTC](https://discuss.pytorch.org/t/does-the-cifar100-dataset-of-pytorch-provide-coarse-labels/10858/4 "2017-12-06T17:49:31Z")

</div>

Thanks for your quick reply.  
I have just check the source code and there is no such option.

Just handled this by simply modifying the source code a little by adding a coarse\_labels key.
