This is so so helpful Thank you so much Literally no other video on TH-cam has a tutorial like this which shows how to save the custom trained yolo model and use it in your own project
If your execution stops with "608 x 608 create 6 permanent cpu-threads"... Check: - all image files are .jpg, no .png - all image files have corresponding .txt labels - the class of your label is what's in the colab notebook, not 'Koala' (i.e if you're using something else)
Great tutorial! Useful content for sure. Thank you very much. Could you let me know the changes which need to be performed for multiple object detection?
Hi Sergio, great tutorial! I have one quick question though which I'm sure a lot of people are wondering about. I keep getting disconnected from colab which prevents me from finishing the training. Instead of training the model from scratch again, is it possible to load latest weights instead of pretrained ones and continue training from there in new session? Many thanks!
I have one question here. How can we use preprinted model and add our newly trained model with that. For example i have 80 classes in coco names but now i trained model with 2 new classes and i want that 80 and also 2 new classes. So in result my model is able to detect total 82 object. Please Help me for this...
you can freeze the model till the last convolution layer, add 82 units in the next layer with softmax activation, and then retrain this last layer with the input of the frozen layer on the new dataset with 82 classes.
Thank you very much Sergio this is a great tutorial. I would be interested in knowing how to extend the code for detecting more classes. Would you give an update?
Hey man! Nice video I really enjoy it, easy to follow and everything but when I get to the last step on the image processing instead of learning it takes only a few seconds and then a message pops up saying "Create 6 permanent CPU-threads ". Any Idea what could be the problem?
@@dicharjachkson8003 Ye I did, it is important that you have the right file format... I had .JPG files but it only accepts .jpg files... Ye, it doesn't accept .JPG with capital letters...
Hi! Excellent video! I've also watched the workshop... Awesome... One question... If I have a "moving" background, not fixed, the only way to track one exclusively item is by Yolo? I was trying but it's very heavy for mobile, isn't it?
Hey, nice tutorial. Thanks a lot. I did the same thing, but suddenly got an error like this one: output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()] IndexError: invalid index to scalar variable. Do you have an idea what is wrong with this? I see taht opencv.dnn.readNet( ) doesnt have any response. But I can't understand why. Can you give me a tip?!
What a great tutorial, I really learned a new thing. I have one question, how can I train this yolov3 and save the model in h5 and cfg files, I am really struggled here ://
hey, great video! I was going to create a video about building a koala bear detector and found you already did it! lol, I will just choose a diferent marsupial : P
Wait, correct me if I'm wrong, but are you using the same dataset of images for both training and testing? Because I don't see you splitting them into the training set and testing set anywhere in your video. Thanks!
Hi I would like to ask why does it prompt "'sed' is not recognized as an internal or external command, operable program or batch file." when I try to run the program
Hey Pysource! Love your videos man. Would it be possible for you to edit and upload an edited version of the Train_Yolov3.ipynb script to allow for multiple classes rather than just one? I was looking at the script trying to figure it out myself but I couldn't work it out. It would be much appreciated.
Hi,thanks alot for such awesome tutorial,I want to ask one thing that if I want to train Yolov3-tiny what changes I have to made to train my custom model.waiting for your reply.
nice work. I'm confused does the training you did on the koala dataset happen on a yolo model with all weights initialized randomly or are the weights of the inner model locked during training? or do you need to import pre trained weights if you want transfer leaning some custom datasets are very small how is it able to fit such a huge model??
Do images in the dataset have to be of some specific size in pixels? also, do all of them have to be of the same type e.g. all of them landscape or square, or it doesn't matter?
The code ran without any error in colab but I didn't get any weights like you showed us in your video. I did exactly like you until 22:00. Can you help me.
i labelled the images as you have mentioned in the tutorial but my text file shows, 15 x x x x, why there is 15 in it not the 0 as you have in your case. Really appreciated your help.
Thank you very much for your response. I had some issue with running of code, my code does not work after installing the darknet. it stops there and show some error like "can not directory yolov3 as it already exists". so when i run the training code it does not work as you have mentioned in the video. thank you for your time.
Thanks for this, the hardest part appears to be setting the parameters in the yolo config file. Yolo's default of 20 - 80 objects is not helpful. 1 class is much easier to start with.
*F.A.Q. : below you'll find my reply to your most requested questions* *1) Train YOLO for multiple classes?* This specific tutorial I've created is for just one class. I wanted to make it as simple as possible for beginners to just get the hands on object detection. If you want to train YOLO for multiple classes do consider buying my Object Detection Course: pysource.com/object-detection-opencv-deep-learning-video-course/ You fill find also a dedicated lesson and python notebook to train your detector for multiple classes. *2) Why does your output stop here: "608 x 608 create 6 permanent cpu-threads"?* This error is difficult to debug, because it might be for a series of errors. Just make sure that you followed the tutorial correctly, that there are no typos on the folder names you've created and most importante, make sure that all the images are ".jpg" format. *3) Weights file are not added to google drive?* First of all make sure that that the training reached at least 100 iterations, after that weights file will be saved each 1000 iterations. *4) Cuda out of memory error?* Probably you have a big dataset of images and the GPU can't fid them all, so your dataset should be smaller, at least to work with these specific settings.
Salve Sergio, sono nell'ultima fase nel mio progetto, non ho più tanto tempo e ho avuto un po di problemi nel mio training, voglio che mi daresti una mano o un piccolo aiuto per favore , il tuo tutorial è il migliore di tutti quelli che ho visto grazie.
Hi sir, I have tried using my own images which I am detecting melon fruit. However, it is not giving me the exact position when i tested it on Python. Perhaps you could explain what may cause it to be inaccurate? Thank you so much sir
Hi Sergio,O have a huge dataset so when i training it the Google colabs time is out and it suggest me to use colab pro which I have to pay for it.My question is can I train a dataset which i already trained? Please answer,thank you for your videos.
I do not find the 2 weight files in my yolov3 folder in my drive ? The Training is not also performed in my program. I followed the same, I changed the Class name from Koala to Apple, Remaining all the things are same. [yolo] params: iou loss: mse (2), iou_norm: 0.75, cls_norm: 1.00, scale_x_y: 1.00 Total BFLOPS 65.304 avg_outputs = 516723 Allocate additional workspace_size = 12.46 MB Loading weights from darknet53.conv.74... seen 64, trained: 0 K-images (0 Kilo-batches_64) Done! Loaded 75 layers from weights-file Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005 Resizing, random_coef = 1.40 608 x 608 Create 6 permanent cpu-threads
Hi Suresh, "Create 6 permanent cpu-threads" the last line of the output is saying "Create 6 cpu-threads", this most likely means that you didn't activate the GPU on your nootebook. That might be the problem, check carefully the video tutorial, I explain how to activate the GPU
Hi! Thanks for the tutorial, can you explain a bit what happens after the image extractions? It is not very clear to me! I'm trying to make a "heads" detector, so I trained the network in images where there are many different heads (in the .txt file I have many rows with the various bounding boxes present in an image). As the camera is on top, it is a very difficult task, indeed, some heads look more like black circles... So I tried to do Data Augmentation, but this time the iteration stops around 1000 instead of 2000, I have no idea why...
Good video, but required resources are incomplete. Missing a link to the notebook file. It is frustrating to get this far and get stuck. I am noob and have no clue how to create one
Hey! great video i just want to know if we were training for multi classes so what changes to be made in this line: !echo "Apple Orange Banana Bread Carrot Grape Juice Lemon Pizza Tomato" > data/obj.names like this ? or this is wrong can u pls help!
There are some stupid mistakes I have made. Sorry for my poor English. 1. Do the exact same way to zip all the files and images. (It means that we should ctrl+A to select all the files and right-click to zip them so that the files will right be inside the zip file.) 2. Be sure that your class.txt should only have one class, and all of the text files should start with 0, which means that it belongs to class 0. (I labeled my data "car", but I selected the one provided by labelImg , so it turned out to be multiple classes.)
🔥Learn how to build your own AI vision solutions: pysource.com/community
This is the most beginner/pro friendly tutorial i've ever seen.
608 x 608 create 6 permanent cpu-threads help this
True
@@kishore3785 did you get the solution to it?
@@kishore3785 same here. How do you fix it?
Please make a video tutorial for multiple class object detection, would be very helpful. Thanks
Wombat in the 4th picture: "Am I a joke to you ?"
This is so so helpful
Thank you so much
Literally no other video on TH-cam has a tutorial like this which shows how to save the custom trained yolo model and use it in your own project
You saved my weekend holiday, thank you!
this tutorial is super easy! thank you for this, I'm training my own yolo weights at the moment
You earned my subscription, too (someone said this below). Great work. Keep it up!
If your execution stops with "608 x 608 create 6 permanent cpu-threads"... Check:
- all image files are .jpg, no .png
- all image files have corresponding .txt labels
- the class of your label is what's in the colab notebook, not 'Koala' (i.e if you're using something else)
My code stops at 608x608
And my images are png , And the weight files are not uploading on my gdrive yolov3 folder :(
hello Doken, can you explain the detail about third point?
Thank you soo much bro, very good and clear lectures , no biting about the bushes.
Sir. It was great to see your video and the way each part was explained was great Thank You and keep up the great work.
Thank you... Awesome... It worked properly for my dataset...
Great tutorial! Useful content for sure. Thank you very much.
Could you let me know the changes which need to be performed for multiple object detection?
simply and easy understanding tutorial, thanks
Great Video!! When it is possible, could you make a video considering 2 classes? Like cats and dogs... or Koalas and Bears? Tks!!!
You’re a master Sir, I had no idea about this and I could do it! Thank u very much!!
where u get dataset?
Hi Sergio, great tutorial! I have one quick question though which I'm sure a lot of people are wondering about. I keep getting disconnected from colab which prevents me from finishing the training. Instead of training the model from scratch again, is it possible to load latest weights instead of pretrained ones and continue training from there in new session? Many thanks!
I have one question here. How can we use preprinted model and add our newly trained model with that. For example i have 80 classes in coco names but now i trained model with 2 new classes and i want that 80 and also 2 new classes. So in result my model is able to detect total 82 object. Please Help me for this...
hi, did you find any way ?
Can you share
you can freeze the model till the last convolution layer, add 82 units in the next layer with softmax activation, and then retrain this last layer with the input of the frozen layer on the new dataset with 82 classes.
khushboo priya transfer learning
super, waiting for next video
you are awesome and ,something to the point and exactness!
Thank you, It's working very well. Please teach how to train multiple animals.
Thank you very much Sergio this is a great tutorial. I would be interested in knowing how to extend the code for detecting more classes. Would you give an update?
Amazing tutorial, everything works
but I did not get the updated weights
I can't get the cnfg file
this is the very good video for beginners, I have ever seen...thnk you so much
Precise and very informative
can I use this same code for multiple object detection?
let me know if you find the answer please
Yeah please let me know too
yes plz let me know too becoz i m also working on same kind of project.
This is exactly what i expected since i had amd ryzen laptop i cant use cuda but this helped me!! Thank you!!
Thank you. Excellent video!!!!
Hey man! Nice video I really enjoy it, easy to follow and everything but when I get to the last step on the image processing instead of learning it takes only a few seconds and then a message pops up saying "Create 6 permanent CPU-threads ". Any Idea what could be the problem?
Hey! i have same problem, do you solved the problem?
@@dicharjachkson8003 Ye I did, it is important that you have the right file format... I had .JPG files but it only accepts .jpg files... Ye, it doesn't accept .JPG with capital letters...
Very informative tutorial - thanks!
El mejor curso, un excelente maestro, gracias por compartir.
Great tutorial, many thanks!!
thank youuuuuu !!!
so glad that I have you
Great video brother, simple and crisp. Also, it would be great if u cud tell me how to implement this for real-time object detection.
Hello, I don't see the image when I execute the programm. Can you help me ?
You earned my subscription. Thanks.
Thank you very much, it's the best tutorial today
Stunned by your work.
Love from Pakistan
From where you have find colab notebook?
This is amazing. Thanks a ton !!
Hi! Excellent video! I've also watched the workshop... Awesome... One question... If I have a "moving" background, not fixed, the only way to track one exclusively item is by Yolo? I was trying but it's very heavy for mobile, isn't it?
you are the best!!! thank you again!!!
Hey, nice tutorial. Thanks a lot.
I did the same thing, but suddenly got an error like this one:
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.
Do you have an idea what is wrong with this?
I see taht opencv.dnn.readNet( ) doesnt have any response. But I can't understand why.
Can you give me a tip?!
Change i[0] to i
@@hienongxuan3588 Thank you.
@@hienongxuan3588 Hello, for me changing i[0] to i only gives the image as it is. It's not identifying the image. What could be the problem?
Nice video loved ..and excellent explanation
How can i train for more than 1 classes
thank you so much!! can you please tell the changes we need for multiple classes
any changes required? i am trying for 3 classes
Thanks! I think my brain just exploded....
Great tutorial! Thank you very much for this.
Can you please make a detailed video on how to detect a custom object in live stream?
Thank You
great video , please tell ..can we use the same method for multiple classes??
Hi Sergio, Thanks for the tutorial. I have a question is the process same for yolov4 ?
Hi Thank you for this fantastic video! May I know how to change the code if we train in local computer GPU instead of Google colab? Thanks!
What a great tutorial, I really learned a new thing.
I have one question, how can I train this yolov3 and save the model in h5 and cfg files, I am really struggled here ://
Great video , thank you
Hey man great video! I'm working on a project which also requires detecting koalas. Is there any chance I could borrow your dataset? Thanks!
Great tutorial. But where can I find your colab notebooks?
Great video! Can we take input as a video rather than an image and work the same way?
hey, great video! I was going to create a video about building a koala bear detector and found you already did it! lol, I will just choose a diferent marsupial : P
By the way, great channel!
Wait, correct me if I'm wrong, but are you using the same dataset of images for both training and testing? Because I don't see you splitting them into the training set and testing set anywhere in your video. Thanks!
I have the same doubt
Please can you start your object detection video course very soon.
unable to find colab notebook on your blog
same here
Hi. Can i use this in video?
Hi I would like to ask why does it prompt "'sed' is not recognized as an internal or external command,
operable program or batch file." when I try to run the program
nice tuto !! is't the same for yollov5 ?
Got to learn some new things. Informative video, not like boring style Videos.
Thank u professor
This is great💯. I really appreciate your work👏.Can we use coco dataset and custom trained models simultaneously?
Same question !
with my experience. the coco works with xml files and the yolo with txt
Same question. Please let me know if you have found a way to do that
Hey, I am not getting the file in my drive after training. What should I do?
that is because you did not save the file in yolo format while using labelImg, you probably saved it with pascal formal.
How to Re-train custom yolo weights?
I am looking for that! Any solution??
Hey Pysource! Love your videos man. Would it be possible for you to edit and upload an edited version of the Train_Yolov3.ipynb script to allow for multiple classes rather than just one? I was looking at the script trying to figure it out myself but I couldn't work it out.
It would be much appreciated.
Thankyou for this! Can you post a code snippet for linking this to a live video feed such as a webcam or drone feed?
Hi,thanks alot for such awesome tutorial,I want to ask one thing that if I want to train Yolov3-tiny what changes I have to made to train my custom model.waiting for your reply.
hi, did you find solution ?
nice work. I'm confused does the training you did on the koala dataset happen on a yolo model with all weights initialized randomly or are the weights of the inner model locked during training? or do you need to import pre trained weights if you want transfer leaning some custom datasets are very small how is it able to fit such a huge model??
Did Anyone solve the transfer learning with previous weights??
@@queenelozabeth can you plaese send the source code
Hey Sergio , did u use the same data for testing and training?
Please make a similar video for detectron2
Do images in the dataset have to be of some specific size in pixels? also, do all of them have to be of the same type e.g. all of them landscape or square, or it doesn't matter?
did you know what is the best image resolution?
Great thank you for sharing,
I have a question, why you didn't put anything in test.txt ?
The code ran without any error in colab but I didn't get any weights like you showed us in your video. I did exactly like you until 22:00. Can you help me.
i encounter same problem.. how do you troubleshoot it?
i labelled the images as you have mentioned in the tutorial but my text file shows, 15 x x x x, why there is 15 in it not the 0 as you have in your case. Really appreciated your help.
That's fine as well, the only important thing is that the number is an univocal ID (so your class is identified by the number 15 instead of 0).
Thank you very much for your response. I had some issue with running of code, my code does not work after installing the darknet. it stops there and show some error like "can not directory yolov3 as it already exists". so when i run the training code it does not work as you have mentioned in the video. thank you for your time.
delete the names in (predefined_classes) found in the data file of the labelImg software
Thanks for this, the hardest part appears to be setting the parameters in the yolo config file. Yolo's default of 20 - 80 objects is not helpful. 1 class is much easier to start with.
*F.A.Q. : below you'll find my reply to your most requested questions*
*1) Train YOLO for multiple classes?*
This specific tutorial I've created is for just one class. I wanted to make it as simple as possible for beginners to just get the hands on object detection.
If you want to train YOLO for multiple classes do consider buying my Object Detection Course: pysource.com/object-detection-opencv-deep-learning-video-course/
You fill find also a dedicated lesson and python notebook to train your detector for multiple classes.
*2) Why does your output stop here: "608 x 608 create 6 permanent cpu-threads"?*
This error is difficult to debug, because it might be for a series of errors. Just make sure that you followed the tutorial correctly, that there are no typos on the folder names you've created and most importante, make sure that all the images are ".jpg" format.
*3) Weights file are not added to google drive?*
First of all make sure that that the training reached at least 100 iterations, after that weights file will be saved each 1000 iterations.
*4) Cuda out of memory error?*
Probably you have a big dataset of images and the GPU can't fid them all, so your dataset should be smaller, at least to work with these specific settings.
Salve Sergio, sono nell'ultima fase nel mio progetto, non ho più tanto tempo e ho avuto un po di problemi nel mio training, voglio che mi daresti una mano o un piccolo aiuto per favore , il tuo tutorial è il migliore di tutti quelli che ho visto grazie.
Hello sergio if you can make a tutorial about SSD custom object detection please
yes, very interested.
thanks, I'm really looking forward for more course from you
thank you for the tutorial, it was very helpful ... what I asked was how I got the testing.cfg file for my custom object detection??
Hi sir, I have tried using my own images which I am detecting melon fruit. However, it is not giving me the exact position when i tested it on Python. Perhaps you could explain what may cause it to be inaccurate? Thank you so much sir
u just saved me! thanks A BUNCH
Thank u sir, i hope you make tutorial more than 1 object detection.
great video, very helpfull
fantastic. thanks for sharing..
wait is this tutorial can use for mutliclass? or just one class?
awesome tutorial!!
Thanks a lot 😊
Hi Sergio,O have a huge dataset so when i training it the Google colabs time is out and it suggest me to use colab pro which I have to pay for it.My question is can I train a dataset which i already trained? Please answer,thank you for your videos.
I do not find the 2 weight files in my yolov3 folder in my drive ?
The Training is not also performed in my program.
I followed the same, I changed the Class name from Koala to Apple, Remaining all the things are same.
[yolo] params: iou loss: mse (2), iou_norm: 0.75, cls_norm: 1.00, scale_x_y: 1.00
Total BFLOPS 65.304
avg_outputs = 516723
Allocate additional workspace_size = 12.46 MB
Loading weights from darknet53.conv.74...
seen 64, trained: 0 K-images (0 Kilo-batches_64)
Done! Loaded 75 layers from weights-file
Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005
Resizing, random_coef = 1.40
608 x 608
Create 6 permanent cpu-threads
same issue here , i tried to change the directory , still the same issue
Hi Suresh,
"Create 6 permanent cpu-threads" the last line of the output is saying "Create 6 cpu-threads", this most likely means that you didn't activate the GPU on your nootebook.
That might be the problem, check carefully the video tutorial, I explain how to activate the GPU
@@pysource-com I followed the tutorial and already activate the GPU on my notebook, but still faced the same error. Any advice?
Explained Well!!!
i try to badminton racket but didnt work, i have 200 images. Can you help my problem?
i cannt find the model weight at my drive yolov3 after training session, how to solve it?
same error....how to solve ?????
Hi! Thanks for the tutorial, can you explain a bit what happens after the image extractions? It is not very clear to me!
I'm trying to make a "heads" detector, so I trained the network in images where there are many different heads (in the .txt file I have many rows with the various bounding boxes present in an image).
As the camera is on top, it is a very difficult task, indeed, some heads look more like black circles...
So I tried to do Data Augmentation, but this time the iteration stops around 1000 instead of 2000, I have no idea why...
Good video, but required resources are incomplete. Missing a link to the notebook file. It is frustrating to get this far and get stuck. I am noob and have no clue how to create one
Hi, the file is available to download at this page pysource.com/2020/04/02/train-yolo-to-detect-a-custom-object-online-with-free-gpu/
Hey! great video
i just want to know if we were training for multi classes so what changes to be made in this line:
!echo "Apple Orange Banana Bread Carrot Grape Juice Lemon Pizza Tomato" > data/obj.names
like this ? or this is wrong can u pls help!
There are some stupid mistakes I have made. Sorry for my poor English.
1. Do the exact same way to zip all the files and images.
(It means that we should ctrl+A to select all the files and right-click to zip them so that the files will right be inside the zip file.)
2. Be sure that your class.txt should only have one class, and all of the text files should start with 0, which means that it belongs to class 0.
(I labeled my data "car", but I selected the one provided by labelImg , so it turned out to be multiple classes.)
I have the problems 2) Why does your output stop here: "608 x 608 create 6 permanent cpu-threads"? at first.
You can also check out the Extract Images part, print(images_list) shouldn't just print []
, it means that it doesn't detect our images.
@@lawrencechen0215 I am getting this problem where it prints [], how can I resolve this?
Model is not getting created after the training. No error is found after Training. What might be the issue ?
Can u explain pls what is Yolo and what is the diff between it and OpenCV ? and which python code editor do u use ?
is there any way on how to put the training result on a graph?
Help please! the training process stop here
"608 x 608
Create 6 permanent cpu-threads "
Thanks. It's a great tutorial and super easy. How to show loss training loss and accuracy anyway?