Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't open file #1184

Open
VincentDuf opened this issue Jul 11, 2018 · 4 comments
Open

Couldn't open file #1184

VincentDuf opened this issue Jul 11, 2018 · 4 comments

Comments

@VincentDuf
Copy link

Hi,
I'm currently trying to train a yolov3-tiny network, but I have recurrent errors.
Each time I launch the command it tells me this:
couldn't open file: data/aphids/black_r_labels(number).txt

First, all my image and their text file associated are existing in the "aphids" directory (i used the Yolo_mark GUI) and all the image are listed in the "train.txt" file.
Second it looks after "black_r_labels(46).txt" for example and several other, and when I retry it is other file (so 145 , 32, 78) for instance, I don't know why.
Finally it looks after "black_r_labels()" despite the name of my files being "black_r_images()"...

Can anyone tell me what's wrong ?

Thank you

@AlexeyAB
Copy link
Owner

@VincentDuf Hi,

Do you use this repository or orginal one? In this repository it can't do such changes, a changes replace-function:

darknet/src/utils.c

Lines 208 to 229 in 3d2d0a7

void replace_image_to_label(char *input_path, char *output_path) {
//find_replace(input_path, "/images/", "/labels/", output_path); // COCO
find_replace(input_path, "/images/train2014/", "/labels/train2014/", output_path); // COCO
find_replace(output_path, "/images/val2014/", "/labels/val2014/", output_path); // COCO
find_replace(output_path, "/JPEGImages/", "/labels/", output_path); // PascalVOC
//find_replace(output_path, "/VOC2007/JPEGImages/", "/VOC2007/labels/", output_path); // PascalVOC
//find_replace(output_path, "/VOC2012/JPEGImages/", "/VOC2012/labels/", output_path); // PascalVOC
//find_replace(output_path, "/raw/", "/labels/", output_path);
// replace only ext of files
find_replace_extension(output_path, ".jpg", ".txt", output_path);
find_replace_extension(output_path, ".JPG", ".txt", output_path); // error
find_replace_extension(output_path, ".jpeg", ".txt", output_path);
find_replace_extension(output_path, ".JPEG", ".txt", output_path);
find_replace_extension(output_path, ".png", ".txt", output_path);
find_replace_extension(output_path, ".PNG", ".txt", output_path);
find_replace_extension(output_path, ".bmp", ".txt", output_path);
find_replace_extension(output_path, ".BMP", ".txt", output_path);
find_replace_extension(output_path, ".ppm", ".txt", output_path);
find_replace_extension(output_path, ".PPM", ".txt", output_path);
}

In the original repo there is this funny issue: pjreddie#842

Try to use the latest version of this repository.

@VincentDuf
Copy link
Author

Okay thanks for answering, I think I might have this problem as it replaces all "image" string in "labels".

Where can I find the latest version ? I downloaded just 2 days ago I supposed it is the latest one right ?

Otherwise I will change the name of my image to avoid this issue.

@AlexeyAB
Copy link
Owner

Did you download this repository https://github.com/AlexeyAB/darknet 2 days ago?

Try to download this: https://github.com/AlexeyAB/darknet/archive/master.zip

@VincentDuf
Copy link
Author

VincentDuf commented Jul 12, 2018

Aaah I forgot to say but I installed darknet using JK Jung's blog (https://jkjung-avt.github.io/yolov3/) but it is still based on the darknet original repository as he used this "git clone https://github.com/pjreddie/darknet yolov3".

I compared the utils.c in my repository and the one you gave me and here is the difference:
the 2 function "find_replace_extension" and "replace_image_to_label" don't exist in my utils.c.
So should I add them manually (and in the header file) or is it a bad idea because there are connection with other file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants