Label class number changed after export dataset

This category is for question related to accounts on

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:

1~0 A~Z
The total number of classes is 37.

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

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):

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

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.

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

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 .