Skip to content
Advertisement

Labelimg crashes when attempting to export YOLO training samples

I’m pretty new to Python and labeling data for deep learning. I have installed Labelimg program in order to label a custom dataset, but it keeps crashing when I create YOLO training samples. Each time I open the program and specify the image directory, I can browse through the images, but when I create my bounding boxes and try to click on the “next image” button, it crashes with an error message.

As a note, I followed this tutorial to install Labelimg.

Here is how I create the error:

  1. Open Anaconda Prompt
  2. Activate the previously-created labelimg environment in conda

conda activate labelimg

  1. Specify location of unzipped labelimg folder

cd D:labelimg

  1. Open python script, followed by location of image directory, previously-created text file with the label name (weed), and previously-created text file with the name of the class in it (weed):

python labelimg.py D:photo_directory D:label.txt D:classes.txt

The program then opens, displaying this:

enter image description here

Notice that I am trying to export samples as YOLO training samples. The name of the picture is “weed0”. Whenever I create my samples and click the “Next Image” button, the program crashes with this error:

JavaScript

What can I do to ensure that the program doesn’t crash when exporting YOLO training samples? I have done everything but reinstall the program, which doesn’t make sense to me because I just downloaded it.

Advertisement

Answer

The solution was to convert image files from .jpg to .png files. After this, it worked flawlessly. This tutorial was very helpful:

https://www.youtube.com/watch?v=FGr3N3DLGEI

In addition, as I was collecting imagery with UAV images (dimensions of 4000×3000 pixels), the program does not like images that large. You can export them using PascalVOC format when it comes to large images, but YOLO format doesn’t like images that large. Cropping down to dimensions of 1000 x 1000 works well.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement