# Label class number changed after export dataset

**URL:** <https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326>\
**Category:** 🤝  Community Help\
**Tags:** export\
**Created:** [January 20, 2023, 1:16am UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326 "2023-01-20T01:16:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Min\_Kim](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/min_kim/32/1083_2.png) [@Min\_Kim](https://discuss.roboflow.com/u/Min_Kim)\
**Post date:** [January 20, 2023, 1:16am UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/1 "2023-01-20T01:16:48Z")

</div>

This category is for question related to accounts on [https://app.roboflow.com/](https://app.roboflow.com/)

Please share the following so we may better assist you:

1. Project type (Object detection, Classification, Polygon, etc.)  
=Object detection

2. The operating system & browser you are using and their versions  
= Colab

3. The screenshot of the error being triggered in your browser’s developer tools/console. Please copy/paste the url below to watch how to pull up your devtools  
= When I upload darknet annotations with images in Roboflow project, export Yolov5 Pytorch format.  
When I see the annotations, class number is totally messed up. Why it happened?

My class is like this:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/a/aca887f97eebd3593992916631f8f46bb6816104.png)  
1~0 A~Z  
The total number of classes is 37.  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/f/f3679a64f3aedba7d3210536997ad3189ad0e2aa.png)

---

<div class="post-metadata">

**Author:** ![Gabriel\_Aversano](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/gabriel_aversano/32/1161_2.png) [@Gabriel\_Aversano](https://discuss.roboflow.com/u/Gabriel_Aversano)\
**Post date:** [January 31, 2023, 10:09pm UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/2 "2023-01-31T22:09:50Z")

</div>

I am having the same issue. Ideally, label numbers should not change even if there are no labels objects with that class.

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [February 2, 2023, 11:29pm UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/3 "2023-02-02T23:29:47Z")

</div>

Hi @Gabriel_Aversano - the YOLOV5 PyTorch format refers to classes in index-values in label files.

Giving your classes numeric values confused the formatting.

You’ll want to use the Modify Classes feature to change the numeric class names (e.g change class `1` to `one`):

- [Image Preprocessing - Roboflow](https://docs.roboflow.com/image-transformations/image-preprocessing#modify-classes)

Generate a new version with Modify Classes and export in YOLOv5 Pytorch format to resume training.

---

<div class="post-metadata">

**Author:** ![Muhammad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/muhammad/32/1852_2.png) [@Muhammad](https://discuss.roboflow.com/u/Muhammad)\
**Post date:** [April 30, 2023, 7:06am UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/4 "2023-04-30T07:06:07Z")

</div>

Hi @Mohamed - I have tried to Modify classes but still I am facing the same issue, like for label 1 I have override with ‘one’. When I generate the version then again my labels are changed, I am augmenting my images. I have also uploaded the images and their label txt files, when I export the dataset without any preproccessing and augmetnation, still changed the labels, Please help me anyone.

---

<div class="post-metadata">

**Author:** ![Muhammad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/muhammad/32/1852_2.png) [@Muhammad](https://discuss.roboflow.com/u/Muhammad)\
**Post date:** [April 30, 2023, 10:19am UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/5 "2023-04-30T10:19:09Z")

</div>

Hi Min\_Kim - Have you resolved this issue, I also facing the same issue. Please let me know if you have resolved it.

---

<div class="post-metadata">

**Author:** ![Muhammad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/muhammad/32/1852_2.png) [@Muhammad](https://discuss.roboflow.com/u/Muhammad)\
**Post date:** [April 30, 2023, 4:01pm UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/6 "2023-04-30T16:01:25Z")

</div>

Hi I have resolved this issue by MySelf, after trying I have found that that Roboflow was actually reading the class/label names in alphbetical order from class.names, so I assign ‘a’ for ‘0’ class and ‘b’ for ‘1’ class and ‘c’ for ‘2’ vice versa .

---

<div class="post-metadata">

**Author:** ![Adriana\_Lizeth\_Vela\_Peña](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/adriana_lizeth_vela_pe%C3%B1a/32/4831_2.png) [@Adriana\_Lizeth\_Vela\_Peña](https://discuss.roboflow.com/u/Adriana_Lizeth_Vela_Pe%C3%B1a)\
**Post date:** [June 9, 2024, 4:52am UTC](https://discuss.roboflow.com/t/label-class-number-changed-after-export-dataset/1326/7 "2024-06-09T04:52:07Z")

</div>

Thank you! I did that and it worked!
