AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.65k stars 7.96k forks source link

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

Open Wenting-Xu opened 4 years ago

Wenting-Xu commented 4 years ago

Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_2290.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_15699.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_6270.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_27267.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_8076.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_29075.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_10081.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_4207.txt Can't open label file. (This can be normal only if you use MSCOCO):/home/xuwt/xu/yolov4/darknet/images/PARP4_frame_813.txt

My images are not in the same folder as txt files. txt files are in the labels folder and images are in the images folder, but they are both in the same level directory in darknet.Training can be carried out.Would you like to put the image and txt file into the same folder?

AlexeyAB commented 4 years ago

Yes.

Wenting-Xu commented 4 years ago

Thanks for your reply! I put the image and TXT file into a same folder, but there was another error.My opencv version is 3.2.0.

[yolo] params: iou loss: ciou (4), iou_norm: 0.07, cls_norm: 1.00, scale_x_y: 1.05 nms_kind: greedynms (1), beta = 0.600000 Total BFLOPS 127.543 avg_outputs = 1051829 Allocate additional workspace_size = 237.17 MB Loading weights from yolov4.conv.137... seen 64, trained: 0 K-images (0 Kilo-batches_64) Done! Loaded 137 layers from weights-file Learning Rate: 0.001, Momentum: 0.949, Decay: 0.0005 If error occurs - run training with flag: -dont_show Resizing, random_coef = 1.40

896 x 896 Create 6 permanent cpu-threads OpenCV exception: load_image_mat_cv OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Error in load_data_detection() - OpenCV OpenCV exception: load_image_mat_cv

Wenting-Xu commented 4 years ago

Hello@AlexeyAB . Can you give me some advice on the above questions?Thank you very much!!

nistarlwc commented 4 years ago

I have solved this problem, the code only use with coco2014 dataset. You can change 'replace_image_to_label' function. @AlexeyAB please update it into master branch. The train operation will be consistent with pjreddie/darknet

void replace_image_to_label(const char* input_path, char* output_path) { // find_replace(input_path, "/images/train2014/", "/labels/train2014/", output_path); // find_replace(output_path, "/images/val2014/", "/labels/val2014/", output_path); find_replace(input_path, "/images/", "/labels/", output_path);

Wenting-Xu commented 4 years ago

Thank you for your help! @nistarlwc I have solved the problem of Can't open label file, and now I mainly face the second problem of OpenCV. I tried many methods, such as training with YOLOv3 on my ubantu18.04, and the results were normal.But the problem has not been solved.Can you give me some more guidance?

Wenting-Xu commented 4 years ago

I solved the problem. As you said, I changed the replace_image_to_label function in utils.c and renamed the folder where JPG images are stored to images.Now the training can go on normally. Thank you very much for your help!! @nistarlwc @AlexeyAB

Yeaminul commented 3 years ago

Hi @Wenting-Xu , I'm still encountering this error. Any winsdom?

Image diretory -> D:\darknet\build\darknet\x64\data\images Label directory -> D:\darknet\build\darknet\x64\data\labels

Tried with putting both Images and Labels in the same directory but encountered -> 'Error in load_data_detection() - OpenCV' error I've provided the absolute directories above for simplicity. Any idea?

My replace_image_to_label function is as below - 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, "\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(input_path, "/images/", "/labels/", output_path); // COCO //find_replace(output_path, "/VOC2007/JPEGImages/", "/VOC2007/labels/", output_path); // PascalVOC //find_replace(output_path, "/VOC2012/JPEGImages/", "/VOC2012/labels/", output_path); // PascalVOC

LokedSher commented 3 years ago

Hello @AlexeyAB ,I encounterd the same problem Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825105606155.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825110616598.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825111944311.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825105255021.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825113737046.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825114605594.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825112126366.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825112420469.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825112310517.txt Can't open label file. (This can be normal only if you use MSCOCO): /home/dl/BigCode2/kyd/darknet-master/darknet-master/build/darknet/x64/data/obj/Back_20200825112203063.txt My jpg files and txt files are in the same folder darknet-master/darknet-master/build/darknet/x64/data/obj as what you sain in readme.md,but the problem still happened. Could you give me some more guidance?