Darknet: Cannot load image

Created on 18 Feb 2018  Â·  6Comments  Â·  Source: pjreddie/darknet

I'm trying to reproduce this tutorial to make sure I understand how things work before training on my data, so I am using his dataset and labels.
I am not very sure how to structure the files so I guess the issue has something to do with it.
I am training on an AWS EC2 server with CUDA 8 and OpenCV 3 pre-installed.

main directory darknet

  • cfg

    • obj.data

    • yolo-obj.cfg (copied yolo-voc.2.0.cfg and changed batch to 64, subdivisions to 8, classes to 1 and filters to 30)

    • obj.names (has exactly one word 'NFPA')

  • data

    • nfpa



      • all the .jpg files and their corresponding .txt files (bounding box)



I am guessing obj.data is the culprit

classes= 1
train = data/nfpa/train.txt
valid = data/nfpa/test.txt
names = data/obj.names
backup = backup/

Part of my Makefile

GPU=1
CUDA=1
CUDNN=1
OPENCV=1
OPENMP=0
DEBUG=0

My issue is yolo
I have checked the text files and the values are normal (not infinity).

Please help. Thank you!

Most helpful comment

i have same issue:
images *.jpg convert into *.png format.
Fixed.

All 6 comments

From the screenshot it seems like you have labels (.txt) and images in same folder it should be in the form of:

  • datafolder/

    • images/

    • labels/

train.txt should contain paths to:

  • datafolder/images/000.jpg
  • datafolder/images/001.jpg
  • datafolder/images/XXX.jpg

and then your labels should be placed and have the structure like this:

  • datafolder/labels/000.txt
  • datafolder/labels/001.txt
  • datafolder/labels/XXX.txt

To be able to provide better help I would like the following:

  • Post a small snippet of train.txt
  • Post all contents of cfg/yolo-obj.cfg
  • Absolute path data folder
  • Absolute path to darknet folder (I guess your screenshot answer this: home directory)
  • Post one-three label files (their content)

Sorry, I forgot to update. I downloaded the VOC dataset and set it up as instructed in the README and things are working now. Before, I got my images and labels folders all mixed up. Thank you for your help :)

check out my comment: https://github.com/pjreddie/darknet/issues/174#issuecomment-445203621
It doesn't have to do with the CUDA or cuDNN versions.

I am getting the same issue Cannot load image "./darknet/dataset/z1.jpg" STB Reason: can't fopen Please help me with this @antnh6 @sachindesh @TheMikeyR

i have same issue:
images *.jpg convert into *.png format.
Fixed.

i have same issue:
images *.jpg convert into *.png format.
Fixed.

I have the same problem, and it worked when I used a png format, but why this happened

Was this page helpful?
0 / 5 - 0 ratings