Hello, i would like to ask you two thinks. 1. is there any way to run this command inside of a python script for a singe image? 2. is there any way to get back the highlighted box(it's bounds) so we can cut it from the original image? Thank you in advance, great job!!
@@TheAIGuy hello sir I really enjoy watching your videos on object detection. I have a suggestion, make a video on how to use reinforcement learning on mobile/computer gaming apps
Hi, I have trained a custom dataset of 10 classes and Once my training is done when I run map command, most of my class scores are zero. Could you please help me out
Thank you very much for this tutorial! I think a video about data augmentation(using imgaug python library) would be awesome. You could show the difference on the results of the yolo detector between the normal dataset and the augmented dataset.
Love the videos, thank you! I have run the training, twice. When I run the test, I get a photo but with no image detection. I've run the training on the Aircraft and Weapon dataset, and on my own dataset. Same result both times. When I run the test from your "YOLOv3 Object Detection with Darknet for Windows/Linux | Install and Run with GPU and OPENCV" video, everything works. I successfully compiled OpenCV with GPU support. I've double checked all my settings and files, and tried to run the test with thresh set to 0.2, as you mentioned in another comment. Still nothing. My training session ran about 5 hours on my RTX 2080 Super GPU. The final line from my training session is "4000: 0.000000, 0.000000 avg loss, 0.000010 rate, 4.989000 seconds, 256000 images, 0.099551 hours left". If you have any insights as to why my training doesn't seem to work I would really appreciate hearing them. Thanks!
while I was running the model for training the weights got loaded but after that I got this errorr: 608 x 608 Create 6 permanent cpu-threads used slow CUDNN algo without Workspace! Need memory: 23293408, available: 7208960 Error: cuDNN isn't found FWD algo for convolution. can anybody help me with this, please. [ i tried changing batch size and sub-divisions but didn't work ]
Thank you so much. I really appreciate your hard work. Just FYI, people who are struggling GPU enabled training (CUDA compiler not detected in Cmake), I finally found the solution. You need to add to path : OpenCV/build/release
After I had run the model for training I could see the class_loss, iou_loss, total_loss on float values. After few minutes that values are -nan. What does this mean?
when updating cfg file for training, is the number of classes equal to the new classes I want the model to learn (1 new class in my case) or all classes the model should detect post-training (80 pre-trained coco classes + 1 new class I want to add/train)? After training, would the model still be able to detect previously trained objects (all 80 object plus the 1 new one)? After training is complete, do i use the cfg file i used for training to detect objects (80 coco classes + the 1 new one I added)?
Thanks for the video, but for some reason, after I ran the detector after following all the steps, my test images did not detect anything. Could you please help me out, my test images are (1920x1080)
Why do we need to specify the data set when running the test when we have already trained the model? Shouldn't the weights and config file be enough? Example: ./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
Hey AI Guy, if I wanted to train the model using a new set of images, whilst still trying to detect the same classes, is it possible to use the final weights from a previous run? E.g. ./darknet.exe detector train data/obj.data cfg/yolov3-custom.cfg yolov3-custom_final.weights ?
I want to train 10 classes. On each image I create some box of 2,3 or 4 classes (it can be the same or different class). But when I train, yolo show error like this: Wrong annotation: class_id = 1. But class_id should be [from 0 to 0] Wrong annotation: class_id = 2. But class_id should be [from 0 to 0] ... Please tell me what am I wrong.
Hey Ai Guy, Thanks so much for your tutorials, during this lockdown I have gone from never coding in my life, never even thinking about how computers work, to now having a pretty good grasp on object detection, trained my own model, played around with tiny yolo and setting it up on my raspberry pi, so a big thank you. But one question- How would you use the detection to trigger some sort of event. Like if dog detected print woof. I had a play with it, but any guidance appreciated. Keep doing what you're doing!
Hey man, if I were to change the width and height of the images in the config file to 608 by 608 or something like that, will it screw up some other configurations or can i just train it with that.
I want only a subset of classes present on the default coco.names list. I keep getting a lot of wrong predictions (most bottles = toothbrush) . Is there a way I can blacklist/remove certain classes from the list?
hey I am running with 1 class. I got this error. Error: l.outputs == params.inputs filters= in the [convolutional]-layer doesn't correspond to classes= or mask= in [yolo]-layer
Hi Thank you for the video...one quick question. Can we use this method in Production as work ? Specially the downloading and training yolo weights from darknet ?
I annotated 80% train images and 20% test images and stored in 2 folders named- train and test. I ran the code and generated train.txt and test.txt . There is no use of test images and their annotation files, only train images are being taken and used. What do I do with the test images?
may i know how do i add the confidence score at the predicted image ? because i saw it appear in the video prediction only. as well how to do cross validation on the yolov3 and show the result through graph like the precision, recall rate and the average precision in the program. thanks in advanced
hey excuse me but please help me if i got eror like this Traceback (most recent call last): File "generate_train.py", line 4, in os.chdir(os.path.join("data", "obj")) FileNotFoundError: [Errno 2] No such file or directory: 'data/obj' what should i do ? please i need it for my final task at university thankyou very much
Hey for some reason everything goes well until 19:20 I don't have the chart popping on my screen. Nothing happens for a few minutes on the powershell and I get a "calloc error". I've tried to put subdivision to 126 but it still give me the error... (and no chart). Got 8Gb on Ram
I have never seen that error before. I would double check your .cfg file because 126 should not be a number you use for subdivisions. You can always check out my "Yolov3 in the cloud" video as it will always work for training a custom yolov3
I'm not sure if this question will be answered further in to the video.. But when you say number of classes do you mean each picture/txt file? And if yes do we include pictures that are in the file and do not have a txt file or should I delete those?
Number of classes refers to how many different objects your model will be able to detect. Example if I'm creating a model to detect cats and dogs then I have two classes. Does this make sense?
Hii Al Guy... I am facing an error at the following lines: model_filename = 'model_data/mars-small128.pb' encoder = gdet.create_box_encoder(model_filename, batch_size=1) the error is : NotFoundError: model_data/mars-small128.pb; No such file or directory I tried to change the directory(cd) to 'deep_sort' as well, but still got the same error. May u please help me
I do have my custom dataset already labeled and so i didn't download the OIDv4 toolkit, I just placed my custom dataset in the data/obj folder and then followed every step until I got an error in the training part. The chart popped out and it shows "not responding". Can you help me with this?
@The AI Guy please help me out. I am facing an error when I run the command to train my model. it says: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. I've installed the latest QT. Still, it is throwing the error. please help mee
Hi Ai Guy, Thanks for wonderful tutorial , it was really helpful I followed it and previous one also to collect custom data , now its training :). I had a doubt if you can clarify , here we are taking pretrain yolo weight and updating as per our new class . will it be a good idea to freez yolo weight , add our own layer on top and train those layer only ? and is this facility available in darknet to add our own convolution layer ?
Hey can you tell me how to incorporate the code for a warning message if a detected object is static for more than suppose 5min, in the existing code. Please let me know . Have already done detection of baggage for custom data set in a video. Thanks for that.....
Please help me! I have one problem: ./darknet.exe : The term './darknet.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch eck the spelling of the name, or if a path was included, verify that the path is correct and try again.
On window prompt, when I run "darknet.exe detector train data/obj.data cfg/yolov3-custom.cfg darknet53.conv.74" It says "GPU isn't used opencv isn't used -data augmentation will be slow" then it runs nothing. To be honest, I haven't installed cuda because my laptop has intel uhd. Without cuda, can't I train yolov3? And speaking of opencv, I tried install opencv source following The AI Guy's other video but I failed to install. Does it have to do with training yolo
Actually my requirement is little strange.. I have a requirement of counting all walnuts placed on a table along with some other dry fruits.. COuld you please help me if my object is not in existng dataset. For example if I am trying to find a special snack from other snacks, is it possible for me to train the system to find that custom item?
@ The AI Guy When I try to test image it is working fine. But I try video I am getting error --> Done! Loaded 107 layers from weights-file Cannot load image videoplayback.mp4 Detection layer: 82 - type = 27 Detection layer: 94 - type = 27 Detection layer: 106 - type = 27 videoplayback.mp4: Predicted in 12.513000 milli-seconds. ^C Do you have any idea about this? OS: Ubuntu 18.04 CUDA: 10.2 CuDnn: 7.6
Does anyone know a way to quantify the accuracy of the model using Darknet commands? I am interested in producing a ROC curve to focus on limiting the amount of false negatives of a particular class
Hi thanks for the video. I have two questions - The chart gave not responding error and showed nothing but an empty chart. How can I fix that? - My shell is not refreshing so fast like yours. It takes ~15 seconds to print the next loss. Is it normal ? Thanks in advance
Hey i want to build a hand gesture detection model using yolov3. Is it possible ? I also want to convert the model to .h5 format as i'll be using it in an ios app. How do i approach ? If i train the train the model using the approach used in this video, will i be able to convert it to .h5 format later? Do you have any suggestions ?
I am able to get the coordinate in the ubuntu terminal using flag "-ext_output". Is there any python script to get the bounding box coordinate of detected object and crop them?
I'm getting this error when i tried to train my model: cannot load image" " STB reason: can't fopen I followed the tutorial exactly, just that i'm using a different dataset. Plz help!! Thanks
sir i got new issue while testing: 1> Insted of image i have image bytes (base 64 encoded) with me is there any way to deal with this. 2> How to crop detected objects. Thanks in advance
the GPU on my computer is an Nvidia GTX 1650, which isn't very strong. I was able to manage about 12 FPS on live video, I know of stronger GPUs who can get up to 30 FPS.
@@TheAIGuy This is a great approach for object detection but not so good for object tracking in real time because you are predicting in each frame. You could make a video using Kalman Filter for example to increase fps. Thanks for the video
@@nicoleiva5498 I have a video on using yolo and deepsort for object tracking! Deepsort already has kalman filters built in!. Thanks for the suggestions and check it out.
I figure it out. I'm using anaconda as python env and many of the packages didn't get downloaded properly, so I looked inside the requirement.txt and manual installed the packages. Now my labels are showing up with values between 0 and 1.
Hello, thank you for these tuto !!! I had a big problem with cmake and build, install the darknet, so i desactivate CUDA, and it works, I'm actually training the darknet with my custom yolo datasets, but it takes a loooot of time, it is 25*GPU ! But no choise because I had a one week strugling to have darnet.exe.. my question is, if I take the weight file obtained after days of training on CPU, and put them in the yolo DeepSORT code, will it work without problem ??? someone had testing this ? thanks in advance.
Hey, my network has been trained but when I try test it on an image it runs fine and tells me that a prediction has been made but no values appear, the prediction.jpg pops up but is just the image normal image(no bounding box or prediction) any ideas on what the problem may be ?
When you run 28:42, it loads the weights then shows a new window called predictions with the image in it, is there a way to straightly detect the image without making the "predictions" window pop up?
when i performed the final testing with a random image from google, I got an error saying: Cannot load image "data/obj.data" has anyone encountered this problem?
Thanks for the great video! I have one question: I trained my custom object detector for two classes: koala and tiger. If I want to add a new class (lion) can I use the weights from the already trained object detector? If yes, I'll have to change the number of classes to 3, the max_batches to 6000 and all the other changes to fit 3 classes or can I set only to the new class to not run 6000 iterations ?
As of right now I don't believe there is a way to add on a class to an already trained model. Since all the configurations in the cfg are different for both models. I know it is annoying but you might have to retrain with the new class from scratch.
@@TheAIGuy Thanks for The answer! I have another question: when i use my obiect detector for an image is there a way to save the result ( image with bounding boxes) as it happens for a video?
Sir i use google colab for training but i face this kind of issue kindly Resolve it . First section must be [net] or [network]: Invalid argument darknet: ./src/utils.c:256: error: Assertion `0' failed.
I followed the same steps but a msg appeared in cmd couldnt open file :data/obj.data Second question i had a gpu tesla k40 (my computer works on windows not linux)i am working on my cpu till now
Nourhan Elaraby did you create the obj.data file and make sure its in the data folder? It can’t seem to find it. You should be able to gpu enable this training.
Firstly, thanks a ton for these videos. when does calculating anchors become necessary? I wish to train a model to detect potholes and previously i had to calculate anchors and also didn't use previously trained weights. Are these two things essential before i start training?
@c j Generating anchors is not essential, you can do it if you are super familiar with neural detection networks but I usually recommend using the default anchors. As for training with pretrained weights this helps to speed up convergence of you model(proper predictions) and provides better accuracy usually. Let me know if you have more questions!
@@joelmathew7998 Yes if you are aiming to have it on mobile then tiny yolo is recommended since it is significantly smaller in size! Let me know if you have questions on configuration for tiny yolo and I can help.
I have trained yolov4 weights by instructions provided in your videos and github repository. how can we use yolov4 weights instead of yolov3 in object detection api? hoping for response. thanks in advance
Im stuck at CMake for past few days. i get an error : "CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1 CUDACXX: CMake Error at CMakeLists.txt:156 (message): CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do not want CUDA." I have both CUDA Toolkit 10.1 and 11.1 installed and System variables set. CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1 CUDA_PATH_V10_1: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1 if i remove CUDA and Open CV it will build it just runs slowly on cpu. any suggestions or can you share a compiled exe with CUDA and openCV enabled that i could download?
you can create a small testing dataset of images and then have a file similar to train.txt but called test.txt or valid.txt. Then when you run your training add the flag "-map" to the end of your "darknet detector train..." command. The chart image showing loss will now also show average precision.
Hello, I do not have a GPU, just a CPU and I want to train more than 20 classes of objects but for every iteration it took me 27 minutes avg :( .. How can I do to have my classes trained ? :(
I am training on a dataset of 400 images of only 1 class. I am using an Intel i5 6th generation 3.3GHz quad core CPU. It's been a day since I am training and it has only reached only 126 iterations and didn't seem to end. It also has a very high total loss of 150. Please help 😕
Tejas Naresh Suvarna this is probably due to a CPU limitation, check out my “Yolov3 in the cloud...” video in order to do this exact same tutorial on a free cloud GPU. It will train much much faster!
Hey AI Guy, Thanks so much for the exhaustive and elaborate video. I am new to Image Processing and AI and your video helped me very much to kickstart. I have been working on a POC for object detection where one of the model types is Threat detection as you captured that in your video. Also for setting up darknet without graphics what different steps i need to perfor. Also I am wondering if you can help me with the model classes for threat detection. I am working on the other models. It's a bit urgent so asked you for that. Would be grateful for your help.
Sorry, im new to deep learning although my final project is about deep learning 😭 . Btw, i would like to ask. Can darknet distinguish between jumping and walking etc. I mean, can it distinguish between different behavior when trained?
after running the darknet command, when reached trying to save the weight file, i got the following error message Saving weights to /backup//yolov3-custom_last.weights Couldn't open file: /backup//up;pv3-custom_last.weights running it as administrator, the backup folder is empty the only different i can find is your video is showing 'backup//' but mine is showing '/backup//', not sure where did i setup wrongly. i had try to redo several time, still the same anyone can help??
in your train.txt folder what does your backup line look like? Make sure you have the backup folder created and is in root folder . I have gotten this before when I didn't have backup folder or it was in wrong place.
first : make sure u have cuda installed second :make sure u have cudnn installed third :make changes in makefile i.e do GPU=1 and cudnn=1 foruth :Recompile it ie re build the darknet ie make it fifth : sit back relaxed and watch ur GPU working
hello i need help, i successfully installed darknet and everything works well. And I need to get this detection into my own code where there will be other parts than voice recognition, as there should be such object recognition using darknet
i am training 5 classes on cpu(intel core i7-5500 2.4Ghz) 8gb ram. how many pictures should i train per classes to have good result? and how long will it take to finish?
Brandy Quijano i would recommend having atleast 300 images per class, the more the better though. It will probably take around 8 hours to train. I recommend watching my “Yolov3 in the cloud” video to see how to train in the cloud with a free gpu and its faster.
@The AI Guy Hello there, thank you for this awesome video, I really appreciate it. After checking out this video I was able to create few YOLOv3 custom object detectors. I am quite new to object detection. There is something that I have been struggling with. After creating two or more YOLOv3 custom object detectors, how do you compare which one is better? Like how to make evaluation (mAP results) between two custom object detectors? Also, when running a test, how do you test your whole dataset, and not just a single image? I have created 'valid = data/test.txt' in 'obj.data' and I have my 'test.txt' file with all the image paths ('data/obj/00088f27177a598c.jpg' and so on) under 'data' folder (just as shown in the video) but whenever I run: './darknet.exe detector test data/obj.data cfg/yolov3-custom.cfg backup/yolov3-custom_last.weights' i keep getting the same msg: 'specify image path'. If I copy paste image path ('data/obj/00088f27177a598c.jpg') from 'test.txt' when asked to 'specify image path' it works normally, but then again it is just for one image. Tried pasting all paths but it did not work. When doing the same for training it works perfectly, when doing testing it seems that it can not find the image path even though I do the steps I mentioned above. I need it for a research so help would be greatly appreciated.
Thanks for your video, and I have question here. I trained my model with 10 categories, and now I want to add the 11th category in my model, if there any method I can do?
I'm getting error while running convert_annotations.py please help Currently in subdirectory: train Converting annotations for class: Tomato Traceback (most recent call last): File "convert_annotations.py", line 60, in os.chdir("Label") FileNotFoundError: [Errno 2] No such file or directory: 'Label'
achyut morbekar this means the generating the dataset probably didnt work if the original annotations werent made, is there a label folder that has txt files in it?
@@TheAIGuy thanks for replying. I got that error. Actually I've got my leaf disease dataset and I used LabelImg tool for annotation, but .xml file are generated not .txt. can you please help me how to generate Label folder and .txt file
Yes you can create a test.txt of similar format to train.txt but with fewer images. There is a special map command you can run to see validation. Refer to the official alexeyab/darknet repository to see the exact command!
Let me know if you guys have any issues that I can help with! YOLOv3 is awesome!
Hello, i would like to ask you two thinks.
1. is there any way to run this command inside of a python script for a singe image?
2. is there any way to get back the highlighted box(it's bounds) so we can cut it from the original image?
Thank you in advance, great job!!
Eustathios Andr hey my most recent video does just this! Check out my “Object detection API” video and it will help you solve these
@@TheAIGuy hello sir I really enjoy watching your videos on object detection. I have a suggestion, make a video on how to use reinforcement learning on mobile/computer gaming apps
Manu Tyagi thanks! I will try and do this.
We do not have darknet.exe file?
This course is very detailed and helps me a lot. Thank you for sharing and looking forward to your update.
Thanks for publishing this. Very hard but valuable information to find.
Hi,
I have trained a custom dataset of 10 classes and
Once my training is done when I run map command, most of my class scores are zero. Could you please help me out
Thank you very much for this tutorial!
I think a video about data augmentation(using imgaug python library) would be awesome. You could show the difference on the results of the yolo detector between the normal dataset and the augmented dataset.
Thanks this helped me for my project..
Took me like 10 hrs to finish training the model..
Looking forward to your YoloV4 Tutorial..
Thanks again.. :)
Love the videos, thank you! I have run the training, twice. When I run the test, I get a photo but with no image detection. I've run the training on the Aircraft and Weapon dataset, and on my own dataset. Same result both times. When I run the test from your "YOLOv3 Object Detection with Darknet for Windows/Linux | Install and Run with GPU and OPENCV" video, everything works. I successfully compiled OpenCV with GPU support. I've double checked all my settings and files, and tried to run the test with thresh set to 0.2, as you mentioned in another comment. Still nothing. My training session ran about 5 hours on my RTX 2080 Super GPU. The final line from my training session is "4000: 0.000000, 0.000000 avg loss, 0.000010 rate, 4.989000 seconds, 256000 images, 0.099551 hours left". If you have any insights as to why my training doesn't seem to work I would really appreciate hearing them. Thanks!
Awesome explaination......Please post video of custom object training using YOLOv4.........much needed!
while I was running the model for training the weights got loaded but after that I got this errorr:
608 x 608
Create 6 permanent cpu-threads
used slow CUDNN algo without Workspace! Need memory: 23293408, available: 7208960
Error: cuDNN isn't found FWD algo for convolution.
can anybody help me with this, please.
[ i tried changing batch size and sub-divisions but didn't work ]
Thank you so much. I really appreciate your hard work.
Just FYI, people who are struggling GPU enabled training (CUDA compiler not detected in Cmake), I finally found the solution.
You need to add to path : OpenCV/build/release
Aniket Shinde thanks for this tip!!
What should I do if I dont' have a release folder in the build folder?
After I had run the model for training I could see the class_loss, iou_loss, total_loss on float values. After few minutes that values are -nan. What does this mean?
I'm really enjoying your object detection series! Question: is there any way to leverage multiple GPUs for training (larger) custom datasets?
Nvm, it's on Joseph's website: pjreddie.com/darknet/yolo/
$ ./darknet detector train cfg/coco.data cfg/yolov3.cfg darknet53.conv.74 -gpus 0,1,2,3
Thanks for the tutorial easy and crisp tutorial! Looking for more updates using the YOLOv4 version.
when updating cfg file for training, is the number of classes equal to the new classes I want the model to learn (1 new class in my case) or all classes the model should detect post-training (80 pre-trained coco classes + 1 new class I want to add/train)?
After training, would the model still be able to detect previously trained objects (all 80 object plus the 1 new one)? After training is complete, do i use the cfg file i used for training to detect objects (80 coco classes + the 1 new one I added)?
Great video once again. I coded along even though my mac doesn't have a GPU, will use this to run this in colab.
What laptop are you running this on?
Thanks for the video, but for some reason, after I ran the detector after following all the steps, my test images did not detect anything. Could you please help me out, my test images are (1920x1080)
This is so cool. Thanks for the video!
Why do we need to specify the data set when running the test when we have already trained the model? Shouldn't the weights and config file be enough? Example: ./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
How to interface/GUI yolo object detection using Django? please help...thanks.
Hey AI Guy, if I wanted to train the model using a new set of images, whilst still trying to detect the same classes, is it possible to use the final weights from a previous run? E.g. ./darknet.exe detector train data/obj.data cfg/yolov3-custom.cfg yolov3-custom_final.weights ?
i got the same error
I want to train 10 classes. On each image I create some box of 2,3 or 4 classes (it can be the same or different class). But when I train, yolo show error like this:
Wrong annotation: class_id = 1. But class_id should be [from 0 to 0]
Wrong annotation: class_id = 2. But class_id should be [from 0 to 0]
...
Please tell me what am I wrong.
Hey Ai Guy, Thanks so much for your tutorials, during this lockdown I have gone from never coding in my life, never even thinking about how computers work, to now having a pretty good grasp on object detection, trained my own model, played around with tiny yolo and setting it up on my raspberry pi, so a big thank you. But one question- How would you use the detection to trigger some sort of event. Like if dog detected print woof. I had a play with it, but any guidance appreciated.
Keep doing what you're doing!
Can you please tell me how you run this on a raspberry pi? Please, please, please
Weapon detection YoloV4 please
really clear , thanks for your awesome work
Hey man, if I were to change the width and height of the images in the config file to 608 by 608 or something like that, will it screw up some other configurations or can i just train it with that.
I want only a subset of classes present on the default coco.names list. I keep getting a lot of wrong predictions (most bottles = toothbrush) . Is there a way I can blacklist/remove certain classes from the list?
what if i have many classes ? it should be data/*/*.jpg right ? and i change number of classes=mynumber for example
hey I am running with 1 class. I got this error. Error: l.outputs == params.inputs
filters= in the [convolutional]-layer doesn't correspond to classes= or mask= in [yolo]-layer
Hi Thank you for the video...one quick question. Can we use this method in Production as work ? Specially the downloading and training yolo weights from darknet ?
I annotated 80% train images and 20% test images and stored in 2 folders named- train and test. I ran the code and generated train.txt and test.txt . There is no use of test images and their annotation files, only train images are being taken and used. What do I do with the test images?
may i know how do i add the confidence score at the predicted image ? because i saw it appear in the video prediction only. as well how to do cross validation on the yolov3 and show the result through graph like the precision, recall rate and the average precision in the program. thanks in advanced
why for the filters we have to do (classes +5)*3 ? where did come from this formule?
My computer doesn't support or have gpu support graphic card , can i still install darknet in the computer for working with yolov3?
when i wrote the lat command of train,it is showing couldn't open data/train.txt. help me
hey excuse me but please help me if i got eror like this
Traceback (most recent call last):
File "generate_train.py", line 4, in
os.chdir(os.path.join("data", "obj"))
FileNotFoundError: [Errno 2] No such file or directory: 'data/obj'
what should i do ? please i need it for my final task at university thankyou very much
Hey for some reason everything goes well until 19:20 I don't have the chart popping on my screen. Nothing happens for a few minutes on the powershell and I get a "calloc error". I've tried to put subdivision to 126 but it still give me the error... (and no chart).
Got 8Gb on Ram
I have never seen that error before. I would double check your .cfg file because 126 should not be a number you use for subdivisions. You can always check out my "Yolov3 in the cloud" video as it will always work for training a custom yolov3
Thank you so much for excellent tutorial. Please upload the tutorials of object detection with SSD and DETR.
I'm not sure if this question will be answered further in to the video.. But when you say number of classes do you mean each picture/txt file? And if yes do we include pictures that are in the file and do not have a txt file or should I delete those?
Number of classes refers to how many different objects your model will be able to detect. Example if I'm creating a model to detect cats and dogs then I have two classes. Does this make sense?
Hii Al Guy... I am facing an error at the following lines:
model_filename = 'model_data/mars-small128.pb'
encoder = gdet.create_box_encoder(model_filename, batch_size=1)
the error is :
NotFoundError: model_data/mars-small128.pb; No such file or directory
I tried to change the directory(cd) to 'deep_sort' as well, but still got the same error.
May u please help me
Is it possible to use pycharm for implementation? Seems like I don’t have darknet.exe . Can be the reason for this? Thanks for answer
I do have my custom dataset already labeled and so i didn't download the OIDv4 toolkit, I just placed my custom dataset in the data/obj folder and then followed every step until I got an error in the training part. The chart popped out and it shows "not responding". Can you help me with this?
@The AI Guy
please help me out. I am facing an error when I run the command to train my model.
it says:
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
I've installed the latest QT. Still, it is throwing the error. please help mee
Hi Ai Guy,
Thanks for wonderful tutorial , it was really helpful I followed it and previous one also to collect custom data , now its training :).
I had a doubt if you can clarify , here we are taking pretrain yolo weight and updating as per our new class . will it be a good idea to freez yolo weight , add our own layer on top and train those layer only ? and is this facility available in darknet to add our own convolution layer ?
Hey can you tell me how to incorporate the code for a warning message if a detected object is static for more than suppose 5min, in the existing code. Please let me know . Have already done detection of baggage for custom data set in a video. Thanks for that.....
Please help me! I have one problem:
./darknet.exe : The term './darknet.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch
eck the spelling of the name, or if a path was included, verify that the path is correct and try again.
I"m unable to run the darknet command. As darknet.exe file is not available in my folder. So what command hsould i follow in linux to run the command.
thank you man for sharing this tutorial
On window prompt, when I run
"darknet.exe detector train data/obj.data cfg/yolov3-custom.cfg darknet53.conv.74"
It says
"GPU isn't used
opencv isn't used -data augmentation will be slow"
then it runs nothing.
To be honest, I haven't installed cuda because my laptop has intel uhd.
Without cuda, can't I train yolov3?
And speaking of opencv, I tried install opencv source following The AI Guy's other video but I failed to install.
Does it have to do with training yolo
I'm actually train without CUDA, it is ok for the moment but it is sloooooooww !
Actually my requirement is little strange.. I have a requirement of counting all walnuts placed on a table along with some other dry fruits.. COuld you please help me if my object is not in existng dataset. For example if I am trying to find a special snack from other snacks, is it possible for me to train the system to find that custom item?
hello, i want to train my model in kaggle is it the same command that you are using in this video?
@ The AI Guy When I try to test image it is working fine. But I try video I am getting error --> Done! Loaded 107 layers from weights-file
Cannot load image videoplayback.mp4
Detection layer: 82 - type = 27
Detection layer: 94 - type = 27
Detection layer: 106 - type = 27
videoplayback.mp4: Predicted in 12.513000 milli-seconds.
^C
Do you have any idea about this?
OS: Ubuntu 18.04
CUDA: 10.2
CuDnn: 7.6
Thejesh kumar are you making sure that your are running the proper command for video? It is not the same command as images.
The AI Guy Yes. Thank you! It’s working now :)
You have really helped me, thank you :)
Does anyone know a way to quantify the accuracy of the model using Darknet commands? I am interested in producing a ROC curve to focus on limiting the amount of false negatives of a particular class
Hi thanks for the video. I have two questions
- The chart gave not responding error and showed nothing but an empty chart. How can I fix that?
- My shell is not refreshing so fast like yours. It takes ~15 seconds to print the next loss. Is it normal ?
Thanks in advance
Hey i want to build a hand gesture detection model using yolov3. Is it possible ? I also want to convert the model to .h5 format as i'll be using it in an ios app. How do i approach ? If i train the train the model using the approach used in this video, will i be able to convert it to .h5 format later? Do you have any suggestions ?
I am able to get the coordinate in the ubuntu terminal using flag "-ext_output".
Is there any python script to get the bounding box coordinate of detected object and crop them?
I am running command and error is occurring :
pthreadVC2.dll: cannot open shared object file: No such file or directory
copy the dll file from darknet/3rdparty/pthreads into the darknet folder and that should fix it!
Getting this error " ObjectNotFound: (.\darknet.exe:String) [], CommandNotFoundExc
eption ". I think this mean darknet.exe is not there.
I have the same problem. darknet.exe is not in the repository
@@kr1spybac0n You need to install it first. He has another video on it.
I'm getting this error when i tried to train my model:
cannot load image" "
STB reason: can't fopen
I followed the tutorial exactly, just that i'm using a different dataset. Plz help!! Thanks
sir i got new issue while testing:
1> Insted of image i have image bytes (base 64 encoded) with me is there any way to deal with this.
2> How to crop detected objects.
Thanks in advance
Great tutorial!! Which GPU did u use for the train? How much fps are u getting while playing a video? And how can I increase the fps ?
the GPU on my computer is an Nvidia GTX 1650, which isn't very strong. I was able to manage about 12 FPS on live video, I know of stronger GPUs who can get up to 30 FPS.
@@TheAIGuy Did u try Nvidia Deep stream for increasing the fps? or TensorRT model instead of normal Tensorflow model
Tuna Akyol no i havent, if you try it and it works well let me know! Thanks.
@@TheAIGuy This is a great approach for object detection but not so good for object tracking in real time because you are predicting in each frame. You could make a video using Kalman Filter for example to increase fps. Thanks for the video
@@nicoleiva5498 I have a video on using yolo and deepsort for object tracking! Deepsort already has kalman filters built in!. Thanks for the suggestions and check it out.
While going through the original website, I saw that 'make' command which didn't run in my Windows 10, So can you please help me with that Sir.
I'm getting wrong annotations for the yolo labels. example Class Pig "212" instead of 0 to 1 range
I figure it out. I'm using anaconda as python env and many of the packages didn't get downloaded properly, so I looked inside the requirement.txt and manual installed the packages. Now my labels are showing up with values between 0 and 1.
@@fabioinspires Glad you figured it out and thanks for sharing how you solved it!
How can I pause training, change the batch size, and resume training using the same loss curve?
I am getting ./darknet the term is not recognized as internal or external command error
Hello, thank you for these tuto !!! I had a big problem with cmake and build, install the darknet, so i desactivate CUDA, and it works, I'm actually training the darknet with my custom yolo datasets, but it takes a loooot of time, it is 25*GPU ! But no choise because I had a one week strugling to have darnet.exe.. my question is, if I take the weight file obtained after days of training on CPU, and put them in the yolo DeepSORT code, will it work without problem ??? someone had testing this ? thanks in advance.
Hey, my network has been trained but when I try test it on an image it runs fine and tells me that a prediction has been made but no values appear, the prediction.jpg pops up but is just the image normal image(no bounding box or prediction) any ideas on what the problem may be ?
Same! Have you found a solution yet?
same here :(
When you run 28:42, it loads the weights then shows a new window called predictions with the image in it, is there a way to straightly detect the image without making the "predictions" window pop up?
Yes you can run the detection command with the flag "-dont_show" added to the end. This will not pop up the image.
Thanks!
when i performed the final testing with a random image from google, I got an error saying:
Cannot load image "data/obj.data"
has anyone encountered this problem?
Lucas B what command were you usung for testing?
@@TheAIGuy just the command listed: ./darknet.exe test data/obj.data cfg/yolov3.cfg backup/yolov3-custom.weights test1.jpg
@@lucasb6517 the proper command is "./darknet.exe detector test..." don't forget the detector part
@@TheAIGuy thanks man, I'm as blind as a bat haha I can't believe I missed that but it works now!
@@lucasb6517 haha no worries. Glad you got it working!
when i start training i get segmentation fault and training process stops. what should i do?
Probably an error with memory. Try reducing batch size and increasing subdivision size in your .cfg
reduce or increase batch and subdivisions by multiples by halving or doubling
The AI Guy thanks for replying i will let you know after trying again
Is there any difference in the process if we want to train a yolov4 model?
Thanks for the great video! I have one question: I trained my custom object detector for two classes: koala and tiger. If I want to add a new class (lion) can I use the weights from the already trained object detector? If yes, I'll have to change the number of classes to 3, the max_batches to 6000 and all the other changes to fit 3 classes or can I set only to the new class to not run 6000 iterations ?
As of right now I don't believe there is a way to add on a class to an already trained model. Since all the configurations in the cfg are different for both models. I know it is annoying but you might have to retrain with the new class from scratch.
@@TheAIGuy Thanks for The answer! I have another question: when i use my obiect detector for an image is there a way to save the result ( image with bounding boxes) as it happens for a video?
Sir i use google colab for training but i face this kind of issue kindly Resolve it . First section must be [net] or [network]: Invalid argument
darknet: ./src/utils.c:256: error: Assertion `0' failed.
I followed the same steps but a msg appeared in cmd couldnt open file :data/obj.data
Second question i had a gpu tesla k40 (my computer works on windows not linux)i am working on my cpu till now
Nourhan Elaraby did you create the obj.data file and make sure its in the data folder? It can’t seem to find it. You should be able to gpu enable this training.
Firstly, thanks a ton for these videos.
when does calculating anchors become necessary? I wish to train a model to detect potholes and previously i had to calculate anchors and also didn't use previously trained weights. Are these two things essential before i start training?
@c j Generating anchors is not essential, you can do it if you are super familiar with neural detection networks but I usually recommend using the default anchors. As for training with pretrained weights this helps to speed up convergence of you model(proper predictions) and provides better accuracy usually. Let me know if you have more questions!
@@TheAIGuy thank you for the quick response.
Should i be training a yolo tiny model if i actually want to run the model in a mobile device ??
@@joelmathew7998 Yes if you are aiming to have it on mobile then tiny yolo is recommended since it is significantly smaller in size! Let me know if you have questions on configuration for tiny yolo and I can help.
@@TheAIGuy can i use the same pre-trained weights used for yolo ( .conv.74 file)?
Hi I’m just assuming I can but if I follow these steps I can also do this in Ubuntu? I will try wish me luck
I think I might have to download Darknet
I have trained yolov4 weights by instructions provided in your videos and github repository. how can we use yolov4 weights instead of yolov3 in object detection api? hoping for response. thanks in advance
Im stuck at CMake for past few days.
i get an error :
"CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
CUDACXX:
CMake Error at CMakeLists.txt:156 (message):
CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do not want CUDA."
I have both CUDA Toolkit 10.1 and 11.1 installed and System variables set.
CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
CUDA_PATH_V10_1: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
if i remove CUDA and Open CV it will build it just runs slowly on cpu.
any suggestions or can you share a compiled exe with CUDA and openCV enabled that i could download?
i fixed it by removing all cuda and reinstalling 10.8
How would you go about testing/validating your custom detector's accuracy and/or performance?
Edit: Wording
you can create a small testing dataset of images and then have a file similar to train.txt but called test.txt or valid.txt. Then when you run your training add the flag "-map" to the end of your "darknet detector train..." command. The chart image showing loss will now also show average precision.
Hello, I do not have a GPU, just a CPU and I want to train more than 20 classes of objects but for every iteration it took me 27 minutes avg :( .. How can I do to have my classes trained ? :(
I am training on a dataset of 400 images of only 1 class. I am using an Intel i5 6th generation 3.3GHz quad core CPU. It's been a day since I am training and it has only reached only 126 iterations and didn't seem to end. It also has a very high total loss of 150. Please help 😕
Tejas Naresh Suvarna this is probably due to a CPU limitation, check out my “Yolov3 in the cloud...” video in order to do this exact same tutorial on a free cloud GPU. It will train much much faster!
Hey, nice video. Do you also get the information how many objects where detected in one image/frame?
You can get some information about the detections by adding the flag "-ext_output" to the end of the detection test command.
Super duper helpful :D
Hey AI Guy, Thanks so much for the exhaustive and elaborate video. I am new to Image Processing and AI and your video helped me very much to kickstart. I have been working on a POC for object detection where one of the model types is Threat detection as you captured that in your video. Also for setting up darknet without graphics what different steps i need to perfor. Also I am wondering if you can help me with the model classes for threat detection. I am working on the other models. It's a bit urgent so asked you for that. Would be grateful for your help.
Sorry, im new to deep learning although my final project is about deep learning 😭 . Btw, i would like to ask. Can darknet distinguish between jumping and walking etc. I mean, can it distinguish between different behavior when trained?
after running the darknet command, when reached trying to save the weight file, i got the following error message
Saving weights to /backup//yolov3-custom_last.weights
Couldn't open file: /backup//up;pv3-custom_last.weights
running it as administrator, the backup folder is empty
the only different i can find is your video is showing 'backup//' but mine is showing '/backup//', not sure where did i setup wrongly. i had try to redo several time, still the same
anyone can help??
in your train.txt folder what does your backup line look like? Make sure you have the backup folder created and is in root folder . I have gotten this before when I didn't have backup folder or it was in wrong place.
Created the backup folder inside darknet folder. Is this OK?
@@jing7253 yup that is what i meant. In your train.txt make the backup line "backup=backup" and see if that works
@@jing7253 that should stop the doubles slashes from appearing and hopefully work
I tried remove the /, still the same. But didn't try remove the space beside the =, will try it later, thanks
Your videos are a great help and information to learn. Would you do a pruning yolov3 video? How to prune a yolov3 model?
The following message is showing up:
"GPU isn't used
OpenCV isn't used - data increase will run slowly"
Does anybody know why?
I do have GPU
What type of GPU do you have?
@@TheAIGuy It's geforce gtx 1080.
What should I do?
first : make sure u have cuda installed
second :make sure u have cudnn installed
third :make changes in makefile i.e do GPU=1 and cudnn=1
foruth :Recompile it ie re build the darknet ie make it
fifth : sit back relaxed and watch ur GPU working
@@hrishikeshsatarkar4266 I did all that but for some reason I still have the same problem :'(
Iu u r using linux platform check which gpu is been used whether the integrated one or nvidia one by nvidia-smi
hello i need help, i successfully installed darknet and everything works well.
And I need to get this detection into my own code where there will be other parts than voice recognition, as there should be such object recognition using darknet
Martin Gelo check out my most recent video! It shows you how to run detections in your own code as APIs.
it says Not compiled with OpenCV when run the output command plz help me
i am training 5 classes on cpu(intel core i7-5500 2.4Ghz) 8gb ram. how many pictures should i train per classes to have good result? and how long will it take to finish?
Brandy Quijano i would recommend having atleast 300 images per class, the more the better though. It will probably take around 8 hours to train. I recommend watching my “Yolov3 in the cloud” video to see how to train in the cloud with a free gpu and its faster.
@The AI Guy Hello there, thank you for this awesome video, I really appreciate it. After checking out this video I was able to create few YOLOv3 custom object detectors. I am quite new to object detection. There is something that I have been struggling with. After creating two or more YOLOv3 custom object detectors, how do you compare which one is better? Like how to make evaluation (mAP results) between two custom object detectors?
Also, when running a test, how do you test your whole dataset, and not just a single image? I have created 'valid = data/test.txt' in 'obj.data' and I have my 'test.txt' file with all the image paths ('data/obj/00088f27177a598c.jpg' and so on) under 'data' folder (just as shown in the video) but whenever I run: './darknet.exe detector test data/obj.data cfg/yolov3-custom.cfg backup/yolov3-custom_last.weights' i keep getting the same msg: 'specify image path'. If I copy paste image path ('data/obj/00088f27177a598c.jpg') from 'test.txt' when asked to 'specify image path' it works normally, but then again it is just for one image. Tried pasting all paths but it did not work.
When doing the same for training it works perfectly, when doing testing it seems that it can not find the image path even though I do the steps I mentioned above. I need it for a research so help would be greatly appreciated.
train.txt file is created but there is no labels included in it. Can you please help me with it?
There should not be any labels in train.txt. It should only have the paths to image files.
Thanks for your video, and I have question here. I trained my model with 10 categories, and now I want to add the 11th category in my model, if there any method I can do?
How do I manipulate the layers using this? I mean how do I freeze certain layers?
I'm getting error while running convert_annotations.py
please help
Currently in subdirectory: train
Converting annotations for class: Tomato
Traceback (most recent call last):
File "convert_annotations.py", line 60, in
os.chdir("Label")
FileNotFoundError: [Errno 2] No such file or directory: 'Label'
achyut morbekar this means the generating the dataset probably didnt work if the original annotations werent made, is there a label folder that has txt files in it?
achyut morbekar and can you see the images downloaded from the toolkit?
@@TheAIGuy thanks for replying. I got that error. Actually I've got my leaf disease dataset and I used LabelImg tool for annotation, but .xml file are generated not .txt. can you please help me how to generate Label folder and .txt file
achyut morbekar in labelmg you can click on where it says “voc” and this will now save them as yolo txt files
achyut morbekar you will want to go into labelimg and resave the annotations as yolo style, you wont need convert_annotations.py if you do thid
what if the diagram average los wont open but it still trains?
Is there a way to plot validation too? So I can see of the model overfited. Thanks
Yes you can create a test.txt of similar format to train.txt but with fewer images. There is a special map command you can run to see validation. Refer to the official alexeyab/darknet repository to see the exact command!
the plot is not appearing under linux, assuming it's not an issue?
thank you for your tutorials, could you please help me in drawing loss and mAP chart, I can't find chart.png path for showing!!