No video

How to Train YOLO v4 Tiny (Darknet) on a Custom Dataset

  Рет қаралды 51,893

Roboflow

Roboflow

Күн бұрын

YOLOv4-tiny is smaller version of YOLO v4 that emphasizes speed in model predictions, which is perfect for limited compute environments (even CPUs) like mobile phones or embedded machine learning.
This YOLO v4 tiny tutorial breaks down what YOLOv4-tiny is, preparing labeled bounding box data for object detection, training a YOLO v4 tiny Darknet model with free resources on Google Colab on your own dataset, and using that model to perform inference. In this example, we train our example model on infrared thermal images.
✅ Subscribe: bit.ly/rf-yt-sub
Tools:
Roboflow - roboflow.com
Public datasets - public.roboflo...
Colab notebook - models.roboflo...
Blog post - blog.roboflow....
Create Labeled Data
CVAT - blog.roboflow....
Follow us on Twitter: / roboflowai

Пікірлер: 103
@asdg199
@asdg199 3 жыл бұрын
I know its already been mentioned below. But if you get this error: CUDA Error: no kernel image is available for execution on the device CUDA Error: no kernel image is available for execution on the device: File exists darknet: ./src/utils.c:325: error: Assertion `0' failed. you can try to change the -gencode arch and code. What I didn't realise was that one line above that comment the guy who wrote the program put this: # compute_30, sm_30 for Tesla K80 # compute_75, sm_75 for Tesla T4 so yeah it was a bit embarrassing that i didn't see that. Hope this helps you
@ironpopcorn6471
@ironpopcorn6471 4 жыл бұрын
If you're running the "Train Custom YOLOv4 Detector" step and it doesn't work due to (CUDA Error: no kernel image is available for execution on the device CUDA Error: no kernel image is available for execution on the device: File exists darknet: ./src/utils.c:325: error: Assertion `0' failed.) The architecture settings are probably not compatible with google colabs K80 GPU. Just add ARCH= -gencode arch=compute_37, code=sm_37 to the make file and you're good to go. github.com/pjreddie/darknet/issues/98
@GlentoranMark
@GlentoranMark 4 жыл бұрын
Could you post your line of code for this? I get the same error whatever I try. I've been given the Tesla T4 so tried (among many combinations): !sed -i 's/ARCH= -gencode arch=compute_75,code=sm_75/ARCH= -gencode arch=compute_75,code=sm_75/g' Makefile Same error.
@noorfaleh82
@noorfaleh82 3 жыл бұрын
I have same error , I thought it’s depending on cuda on nvidia gpu I have amd !!!
@hessaaleissa1460
@hessaaleissa1460 5 ай бұрын
At “set up training file directions for custom dataset” there is error “No such file or directory ‘/content/darknet/‘/content” how can i fix that error?
@samvandhapathak2167
@samvandhapathak2167 4 жыл бұрын
Thanks for the tutorial. I finally got the YOLO v4- tiny working with idea from your videos. Now with the saved weights I want to use my Raspberry Pi to detect the same in real time for a object detection project. Please guide me through. Any help will be appreciated. Thanks
@mustafagoksu7661
@mustafagoksu7661 3 жыл бұрын
Have you been able to run these resulting weights in raspbery?
@samvandhapathak2167
@samvandhapathak2167 3 жыл бұрын
@@mustafagoksu7661 yes I implemented this on raspberry pi 4 4gb using tensor flow rather than suggested tensor flow lite. However the fps is around 1.5 only
@mustafagoksu7661
@mustafagoksu7661 3 жыл бұрын
@@samvandhapathak2167 very beautiful. Can you explain how to do it? What should I do with these weights? What should I do with these weights?
@zeze3949
@zeze3949 3 жыл бұрын
Hi , can you post the tutorial you followed for that plz
@daffaaminuddin8580
@daffaaminuddin8580 3 жыл бұрын
@@mustafagoksu7661 where i can get the saved weights file after trained? drive?
@you3667
@you3667 3 жыл бұрын
I solved "CUDA Error: no kernel image is available for execution on the device: File exists". 1. Check the GPU version. Enter the "!nvidia-smi", you can see the GPU version ex) | 0 Tesla K80 Off | 00000000:00:04.0 Off | 0 | | N/A 53C P8 31W / 149W | 0MiB / 11441MiB | 0% Default | you can see the GPU version K80. 2. Change the compute_capability. ex) if your version is K80, execute "%env compute_capability=30" else version is T4, execute "%env compute_capability=75" I don't know exactly. But sometime this kind of situation occurs. "Yesterday version was P100, but today version is K60." So make sure check the GPU version 3. Change the "!sed" part. ex) %cd darknet/ !sed -i 's/OPENCV=0/OPENCV=1/g' Makefile !sed -i 's/GPU=0/GPU=1/g' Makefile !sed -i 's/CUDNN=0/CUDNN=1/g' Makefile !sed -i "s/ARCH= -gencode arch=compute_60,code=sm_60/ARCH= -gencode arch=compute_(change this),code=sm_( change this)/g" Makefile !make ex) if your version is K80, chage this part ---> !sed -i "s/ARCH= -gencode arch=compute_60,code=sm_60/ARCH= -gencode arch=compute_30,code=sm_30/g" Makefile
@mehmetkaanergul8641
@mehmetkaanergul8641 3 жыл бұрын
YOU ARE AN AMAZING PERSON THANK YOU VERY MUCH
@you3667
@you3667 3 жыл бұрын
@@mehmetkaanergul8641 ^^
@gaganagavesh3679
@gaganagavesh3679 3 жыл бұрын
Does the GPU version change time to time. With Tesla P4 I have above error and I still couldn't fix it...Please help.
@gaganagavesh3679
@gaganagavesh3679 3 жыл бұрын
Fixed it, Thank you very much for the solution.....😍😍😍
@noorfaleh82
@noorfaleh82 3 жыл бұрын
@@gaganagavesh3679 can you tell me how fix it ?
@eswar9255
@eswar9255 8 ай бұрын
Now there is no Darknet executable file. what can I do? from where can I get that file?
@__________________________6910
@__________________________6910 2 жыл бұрын
I love how you explain and your talking style is very fine love this
@musabahmed567
@musabahmed567 Жыл бұрын
I'm getting this error: "Makefile:162: recipe for target 'obj/convolutional_layer.o' failed make: *** [obj/convolutional_layer.o] Error 1". Can anybody please help?
@Roboflow
@Roboflow Жыл бұрын
Hi! Could you post a bug report with all the details on our notebooks repository: github.com/roboflow-ai/notebooks
@strizerz3514
@strizerz3514 Жыл бұрын
I am getting a new error with darknet - "/bin/bash: ./darknet: No such file or directory". I have been stuck on this for hours, Do you have any solutions? Thank you!
@rifqyfachrizi7891
@rifqyfachrizi7891 Жыл бұрын
are you solve this problem?
@strizerz3514
@strizerz3514 Жыл бұрын
@@rifqyfachrizi7891 no
@ballajaisheel1120
@ballajaisheel1120 4 ай бұрын
@@strizerz3514 same error...if you got it just reply me
@samvandhapathak2167
@samvandhapathak2167 4 жыл бұрын
At the end of the video you switch to a model that is already trained and it can be clearly seen that the colab page you were on also shows a CUDA error. Please suggest ways to correct that. Great video and also love roboflow for data prep
@Roboflow
@Roboflow 4 жыл бұрын
Thanks for your kind words! Yes, the CUDA configuration will depend on what GPU you're using in Colab. The notebook assumes a P100 (and this is the one I switch to at the end). The prior is on Colab free and uses a K80. The CUDA config file in the notebook allows this to be modified to your hardware.
@samvandhapathak2167
@samvandhapathak2167 4 жыл бұрын
@@Roboflow while I am using the free version with K80, what changes should i make to run the training. Tried a few things didn't work☹️
@junaidkhan-uc2eb
@junaidkhan-uc2eb 4 жыл бұрын
Were you able to resolve this issue?
@noorfaleh82
@noorfaleh82 3 жыл бұрын
@@junaidkhan-uc2eb I have the same error
@ArunMPEdison
@ArunMPEdison 3 жыл бұрын
Great video! Thank you for sharing, curiously watching for which tools you have used for custom training from scratch.
@noorfaleh82
@noorfaleh82 3 жыл бұрын
How can download the complete file with weights and cfg file after training it on google colab to use on GPU kit ?
@vaperon
@vaperon 4 жыл бұрын
Hello, i tried the make same example work but couldnt managed to get your example work. Getting this error: CUDA status Error: file: ./src/blas_kernels.cu : () : line: 841 : build time: Aug 10 2020 - 14:41:39 CUDA Error: no kernel image is available for execution on the device CUDA Error: no kernel image is available for execution on the device: File exists darknet: ./src/utils.c:325: error: Assertion `0' failed. Any solution for this?
@samaylakhani7959
@samaylakhani7959 4 жыл бұрын
Check the !sed command on top of the notebook. It’s built for P100 GPUs. Uncomment the K80 or T4 if you’re on Google Colab. If you’re using another GPU check the other comments.
@mehmetkaanergul8641
@mehmetkaanergul8641 3 жыл бұрын
I solved "CUDA Error: no kernel image is available for execution on the device: File exists". 1. Check the GPU version. Enter the "!nvidia-smi", you can see the GPU version ex) | 0 Tesla K80 Off | 00000000:00:04.0 Off | 0 | | N/A 53C P8 31W / 149W | 0MiB / 11441MiB | 0% Default | you can see the GPU version K80. 2. Change the compute_capability. ex) if your version is K80, execute "%env compute_capability=30" else version is T4, execute "%env compute_capability=75" I don't know exactly. But sometime this kind of situation occurs. "Yesterday version was P100, but today version is K60." So make sure check the GPU version 3. Change the "!sed" part. ex) %cd darknet/ !sed -i 's/OPENCV=0/OPENCV=1/g' Makefile !sed -i 's/GPU=0/GPU=1/g' Makefile !sed -i 's/CUDNN=0/CUDNN=1/g' Makefile !sed -i "s/ARCH= -gencode arch=compute_60,code=sm_60/ARCH= -gencode arch=compute_(change this),code=sm_( change this)/g" Makefile !make ex) if your version is K80, chage this part ---> !sed -i "s/ARCH= -gencode arch=compute_60,code=sm_60/ARCH= -gencode arch=compute_30,code=sm_30/g" Makefile
@victoravila7305
@victoravila7305 3 жыл бұрын
@@mehmetkaanergul8641 It worked! Thank you, bro!
@tiwill345
@tiwill345 3 жыл бұрын
@@mehmetkaanergul8641 thx ! this helped me !
@noorfaleh82
@noorfaleh82 3 жыл бұрын
@@mehmetkaanergul8641 I check not work the same error appear 😢
@sureshkumar0707
@sureshkumar0707 3 жыл бұрын
How to plot the learning graph for this Project?
@TheBradleydwyer
@TheBradleydwyer 4 жыл бұрын
I don't know if the energy level one-uppance is sustainable. But I'm excited to find out...
@Roboflow
@Roboflow 4 жыл бұрын
Stay tuned!
@brili2065
@brili2065 3 жыл бұрын
I finished these steps. So, how to transplant the training model in colab to jetson nano platform?
@nikhilshashidhar7195
@nikhilshashidhar7195 2 жыл бұрын
Can I use YOLOv4-Tiny generated weights and use those weights on a scaled v4 algorithm?
@Huds-ux1xb
@Huds-ux1xb 8 ай бұрын
Hey i cant use yolov4 with darknet , can you give me any tutorial
@CoxopopYance
@CoxopopYance 3 жыл бұрын
Do you have a .py to use that custom pre trained dataset in my desktop??? I want it to use with my video camera
@marcialzipaganjr.681
@marcialzipaganjr.681 2 жыл бұрын
@Roboflow how should I generate a tflite version of the model I just trained? Also, if I wanted to improve the model again what should I input with the config file? Example the model is initially trained on 2 classes and after sometime I wanted to try it out with 4 more new classes? Should I input 4 on the number of classes or 6?
@Iamanandraj
@Iamanandraj 4 жыл бұрын
can you tell me which software you are using for screen recording and virtual webcam.
@syedmuslim4532
@syedmuslim4532 Жыл бұрын
hey can you help me out i am stuck in your video in custom training config for yolo v4 the cfg file have you written it or have copied it from somewhere it'll a great help if you respond to make question!! waiting for your reply.. the timing around 19:20
@triggerheaven
@triggerheaven 6 ай бұрын
Can you make video for Yolov7?
@avirupdey7565
@avirupdey7565 3 жыл бұрын
At 20:15 you have got a CUDA error, exactly same as mine. Surprisingly, you just ignored that and headed to another notebook. How to fix that error? Pls reply.
@shahrinnakkhatra2857
@shahrinnakkhatra2857 3 жыл бұрын
what if i want to do augmentation for specific classes only? ( I want to use SMOTE to balance my dataset)
@karlboyefio8121
@karlboyefio8121 Жыл бұрын
Hello, when at the ""Train Custom YOLOv4 Detector" stage, I get this response; "/bin/bash: ./darknet: No such file or directory" . What do I do to solve this?
@Roboflow
@Roboflow Жыл бұрын
There is an open issue in our repository: github.com/roboflow/notebooks/issues/28 for now we don't have fix for that issue unfortunately :/
@malikbilal6061
@malikbilal6061 2 жыл бұрын
If its possible to test Yolov4-Tiny Object detection Model on Arduino Nano .
@preeyank8470
@preeyank8470 3 жыл бұрын
I am getting cuda error everytime during training if I get K80 or T4 gpu. Can anyone help?
@GlentoranMark
@GlentoranMark 4 жыл бұрын
The Colab Notebook is different from the video, can anyone explain what changes are needed? I found I was using the T4, is this code correct ? (I'm not too familiar with Python) #install environment from the Makefile %cd darknet/ # compute_30, sm_30 for Tesla K80 # compute_75, sm_75 for Tesla T4 !sed -i 's/ARCH= -gencode arch=compute_75,code=sm_75/g' Makefile !make
@fixitmoditbreakit7982
@fixitmoditbreakit7982 4 жыл бұрын
Got the same issue
@GlentoranMark
@GlentoranMark 4 жыл бұрын
@@fixitmoditbreakit7982 I'm trying again on the K80 and nothing works, same errors no matter what I try.
@fixitmoditbreakit7982
@fixitmoditbreakit7982 4 жыл бұрын
GlentoranMark I’ve tried lots of different things. One thing I did notice is that the !sed-i’s line is red once uncommented!!
@fixitmoditbreakit7982
@fixitmoditbreakit7982 4 жыл бұрын
@@GlentoranMark hey i just set it up with out copying the notebook and it works!! the files get saved in darknet backup. i haven't tested yet but the tests it runs at the end worked fine . also you get the pc100 so dont have to edit that part
@fixitmoditbreakit7982
@fixitmoditbreakit7982 4 жыл бұрын
it works but when trying to train again i didnt get the pc100
@anime_on_data7594
@anime_on_data7594 2 жыл бұрын
how can we try to run on video. what command we should give for it?
@nouhabenabdelljelil3271
@nouhabenabdelljelil3271 3 жыл бұрын
Hello there , I want to crop what is inside the bounding box and save it in a file in order to apply tesseract later(OCR).Can anyone help me plz?
@juancamilocetinaberdugo4255
@juancamilocetinaberdugo4255 2 жыл бұрын
hi, were you able to fix it?
@akmalyafi1470
@akmalyafi1470 2 жыл бұрын
hey your colab code is different from this video...
@akashanil4540
@akashanil4540 3 жыл бұрын
can we use inference on an vid by replacing img path with a video path
@mustafagoksu7661
@mustafagoksu7661 3 жыл бұрын
How can we run these obtained weights in raspbery ?
@elrayyes_leb8872
@elrayyes_leb8872 2 ай бұрын
darknet is no longer supported on colab
@tarangini22
@tarangini22 2 жыл бұрын
How to inference using videos?
@__________________________6910
@__________________________6910 2 жыл бұрын
you are best
@JoelPrabhod
@JoelPrabhod 3 жыл бұрын
What are the tiny yolo weight sizes?
@jamilahmarramduarte1575
@jamilahmarramduarte1575 Жыл бұрын
Is it okay to run this without gpu?
@Spence1976
@Spence1976 Жыл бұрын
Hello Bear :)
@freecode.ai-
@freecode.ai- 3 жыл бұрын
I trained my own dataset and it works great! The weights are 22mb. Is there a way to reduce the size of the weights file? I can afford to reduce accuracy if I need to. Thanks
@nabsmyfoot5308
@nabsmyfoot5308 3 жыл бұрын
where do i download the trained weight file and the config file after training
@Kaalkian
@Kaalkian 3 жыл бұрын
is there python opencv script running tiny yolov4?
@furqanguru7968
@furqanguru7968 3 жыл бұрын
You did not train it on custom dataset
@_XY_
@_XY_ 2 жыл бұрын
Nice
@selimtasdemir
@selimtasdemir 3 жыл бұрын
can you tell me pls how can i create our own dataset
@Roboflow
@Roboflow 3 жыл бұрын
Yup! kzbin.info/www/bejne/hX7KgmWAr7R0jaM
@TomattoTomatto
@TomattoTomatto Жыл бұрын
/bin/bash: ./darknet: No such file or directory
@ballajaisheel1120
@ballajaisheel1120 4 ай бұрын
same error ...help me to go through it
@tliu9896
@tliu9896 3 жыл бұрын
Not free
@yoloyolo6310
@yoloyolo6310 3 жыл бұрын
you need to pay money to export photos to google colab. it is trash.
How to Train YOLOv5 on a Custom Dataset
28:39
Roboflow
Рет қаралды 218 М.
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 26 МЛН
If Barbie came to life! 💝
00:37
Meow-some! Reacts
Рет қаралды 47 МЛН
how to train YOLO v3, v4 for custom objects detection | using colab free GPU
35:34
When Maths Meet Coding
Рет қаралды 171 М.
Does this sound illusion fool you?
24:55
Veritasium
Рет қаралды 413 М.
How to Train YOLOv4 on a Custom Dataset (PyTorch)
23:18
Roboflow
Рет қаралды 26 М.
YOLOv8: How to Train for Object Detection on a Custom Dataset
20:31