-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Error in load_data_detection() - OpenCV when training on my custom data in windows 10 #2237
Comments
HI, @asdsdlgl did you manage this problem. I am also stucked here... please help... All my images and their annotations are are in the correct path, but still don't know why its happening.. @AlexeyAB |
Hi , I am also stuck in this error anyone have a solution? |
OK, the error is resolved when I again generate the train and valid.txt files by writing the absolute path of all image files. Here is the code:
|
hi! i am a newbie, even i am getting the same error and i use the below code for generating train and test files could you help me by making changes to below code:
|
I have the same problem couldn't solve yet. Could anyone help me please. |
I have the same problem here. All i did is DOUBLE CHECK the path or the images |
Hi I had the same problem and I solved it by cloning darknet into a different directory (and compiling, and executing). I'm using c:\darknet as my base directory and now everything works. In my case I suspect it was related to my directories having spaces in the names. Also I rechecked that all directories were marked with a \ and not \ or /. I hope it may help. |
because it's no data |
I changed my input images from 3 channel image (normal RGB image) to 6 channel image. Because I want to train on 6 channel image. Anyone if have tried to train on more than 3 channel image, please let know, thanks |
For everyone on ubuntu having this issue, just put your labels and images folder in the darknet folder. That works for me! |
|
Well the error is actually related to your train.txt file. If you put in some directory of the train images in the train.txt file where it cannot find/read the image, then this error shows up. Please check the directory again if you are facing this. |
Thanks a lot,I have solved it already |
Glad to hear that, actually I ran into the same problem yesterday and later I found out that I mistakenly put the image paths of the validation set into the train.txt. |
I encountered the same problem, solved it by giving the absolute path of the image folder in the code. |
Please share the code |
how to solve this problem please help me !./darknet detector train data/multiple_images.data cfg/yolov4-custom.cfg yolov4.conv.137 -dont_show Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV |
I solved the problem by having the test.txt and train.txt files changed |
Thanks a lot brother. this solved my problem too. I had to do some other changes also because of directory issues. but this idea of your saved my life. Thanks again. |
Actually, this problem is caused due to wrong path. the training process is executed inside the darknet directory, while your images are inside a subdirectory darknet/data/'your_imgaes_folder_name' . To overcome this problem you need to make sure that you run the script that generats train.txt and test.txt in the darknet folder, and make sure that you write the right path to your images in the script that it can find the images. I will show you this in an example below: I use a python script called process.py downloaded online from this github link. The script is shown below: current_dir = "multiple_images"
hope this explains well |
I was able to resolve the issue by replacing .jpg in train.txt and test.txt with .JPG |
I use Ubuntu 20.04 with an RTX 3060 and the same problem also occurs Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV I checked my train.txt and everything is correct. I added the labels in the data/labels folder and the images in data/obj/ and I still get an error. |
@GabrielFerrante did you solve this error? CUDA-version: 11020 (11060), cuDNN: 8.1.1, CUDNN_HALF=1, GPU count: 1 608 x 608 Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV Error in load_data_detection() - OpenCV |
I solved this problem on Google Colab by using absolute path. Generally if you follow the direction, your path would look like something similar to following:
|
Make sure 2 things,
|
Hey did you solved it? I am having the same issue. |
Hey I am using jetpack 4.6.1 and I have changed the directory just as you mentioned but still getting the same error even the files are in data/image format. The script I used is following beacause my dataset is already divided into 3 folders (train test split) and I have already copied them to darknet/data. import os Define the base directory where Darknet is locatedbase_dir = "/home/talix/darknet" Define the directories containing the imagesimage_dirs = ["test", "train", "valid"] Open files for writing train.txt, test.txt, and valid.txt file pathsfile_train = open(os.path.join(base_dir, "train.txt"), "w") Function to write file paths to the appropriate filesdef write_file_paths(file_handle, file_paths): Loop through each image directoryfor image_dir in image_dirs:
Close all file handlesfile_train.close() |
I resolved it by noticing that some images were corrupted. So fixing them was the solution. Some times I had to change the image channel from RGB to BGR and it worked. But there were also images that I had to delete |
I have the issue when i train my custom data in windows 10, it will show the error " Error in load_data_detection() - OpenCV " when loading the image. And if i just test data using pretrained-weight not training, it will correctly detect the result.
And i try different versions of opencv, including 3.4.5 3.4.10 4.1.0, all of them are failed. My cuda version is 10.0 and vs2017.
How to resolve this problem that " Error in load_data_detection() - OpenCV " when training custom data?
The text was updated successfully, but these errors were encountered: