darknet icon indicating copy to clipboard operation
darknet copied to clipboard

Can't open label file. (This can be normal only if you use MSCOCO)

Open adilraja opened this issue 5 years ago • 10 comments

Hi folks, I am trying to run darknet on a linux based super computer. The system has a large number of Nvidia GPUs and I wanted to leverage that. Since I have limited access to the system as one of the many users, I have to submit jobs to its GpuQ (GPU queue) through a slurm script. And when I run darknet, it works well at times. But at times it gives the following error:

Can't open label file. (This can be normal only if you use MSCOCO)

On the same system, I ran darknet as a batch job (i.e. without using GPU queue through slurm) and darknet worked fine. I wonder if someone will like to offer any help on this issue please!

adilraja avatar Jul 16 '19 16:07 adilraja

AlexAB fork (https://github.com/AlexeyAB/darknet) probably expect annotations (labels) in the tame directory where images are.

ivomarvan avatar Dec 11 '19 14:12 ivomarvan

Hi folks, I am trying to run darknet on a linux based super computer. The system has a large number of Nvidia GPUs and I wanted to leverage that. Since I have limited access to the system as one of the many users, I have to submit jobs to its GpuQ (GPU queue) through a slurm script. And when I run darknet, it works well at times. But at times it gives the following error:

Can't open label file. (This can be normal only if you use MSCOCO)

On the same system, I ran darknet as a batch job (i.e. without using GPU queue through slurm) and darknet worked fine. I wonder if someone will like to offer any help on this issue please!

Hi adilraja

I encountered the same question as you, I wonder wether you have solve this problem?

Sim-ai avatar Oct 05 '20 12:10 Sim-ai

The problem can usually be solved with checking your train.txt and test.txt or directories for incorrect or misspelled endings. In my case it was "../data/obj/Download.xml.txt" instead of the usual "../data/obj/Download.txt".

erikinfo avatar Oct 11 '20 14:10 erikinfo

I'm having the same issue while training. Please note that I'm using the chest x-ray images as my data set. All the images and labels are stored in the same directory: /darknet/data/obj

sasikanthadiraju avatar Nov 07 '20 07:11 sasikanthadiraju

Copying all the *.txt labels into the same folder as the images solved the problem for me.

max-unfried avatar Dec 29 '20 09:12 max-unfried

  1. the reason you got this issue is that you miss some txt labels file in the path darknet/data/obj For example, you included 0001.txt in darknet/data/train.txt, but 0001.txt doesn't' exist in the folder darknet/data/obj

  2. why it can be normal in MSCOCO? because COCO 2017 train dataset have 1021 images which have no annotations

  3. how to deal with this issue make sure the txt file in darknet/data/train.txt is equivalent to the folder darknet/data/obj

forever208 avatar Jan 15 '21 22:01 forever208

I had the same problem because I somehow removed the put txt-files in the directory and forgot to put them back. Silly of me. Just in case of someone like me behave like an idiot sometimes😥

Gare-Ng avatar May 05 '21 13:05 Gare-Ng

For me, I had renamed my label files differently to the images. The label filenames must match the image filenames exactly (except for the extension).

spotiris avatar Nov 13 '21 14:11 spotiris

  1. the reason you got this issue is that you miss some txt labels file in the path darknet/data/obj For example, you included 0001.txt in darknet/data/train.txt, but 0001.txt doesn't' exist in the folder darknet/data/obj

    1. why it can be normal in MSCOCO? because COCO 2017 train dataset have 1021 images which have no annotations

    2. how to deal with this issue make sure the txt file in darknet/data/train.txt is equivalent to the folder darknet/data/obj

is it compulsory to have label files in train.txt too. i have them in data/obj. Also training has begun but it still prints "cant open file" a few times in between

Maharshi-joshi avatar Apr 12 '22 06:04 Maharshi-joshi

Copying all the *.txt labels into the same folder as the images solved the problem for me.

Hi, I've encountered the same problem when I trained my models. May I ask, if my dataset was in aic_hcmc2020 then inside it I got an images folder storing all the images files and labels folder storing all the labels files, then based on your recommendation, I should have stored all the images and labels inside one folder inside the aic_hcmc2020, example like data?

prammmoe avatar Jul 31 '23 02:07 prammmoe