Open Nazrindino97 opened 4 years ago
Hi!
There is an excellent tutorial in https://medium.com/@quangnhatnguyenle/how-to-train-yolov3-on-google-colab-to-detect-custom-objects-e-g-gun-detection-d3a1ee43eda1 to train custom yolo using darknet in colab. Some of the steps before '%cd /content/drive/My Drive/darknet !./darknet detector train data/obj.data cfg/yolov3-obj.cfg darknet53.conv.74' is :
1.-from google.colab import drive drive.mount('/content/drive')
2.-!unzip "/content/drive/My Drive/darknet.zip" #this is the root where to paste your darknet.zip file
3.- %cd darknet !make !chmod +x ./darknet #this commands lets you set you current directory (darknet folder) and compile darknet
4.-!rm /content/darknet/backup -r !ln -s /content/drive/'My Drive'/YOLOv3_weight/backup /content/darknet #this is the directory there weights will automatically save.
5.- !sudo apt install dos2unix
6.- !dos2unix ./data/train.txt !dos2unix ./data/val.txt !dos2unix ./data/yolo.data !dos2unix ./data/yolo.names #default yolo !dos2unix ./cfg/yolov3_custom_train.cfg
7.- %cd /content/darknet !./darknet detector train data/yolo.data cfg/yolov3_custom_train.cfg darknet53.conv.74
Consider that darknet.conv.74 is located inside the current directory (darknet folder)
All this could let you train your model.
One more question, the level (txt file) of every image that wants to be trained, does it need to include in the same file as images? Should be in data/labels
Remember preserve .png files of the default folder 'labels', because this will be use to 'name' your objects when you test with an image.
Sorry if my written english its no so good hahah
Regards
I want to train my own custom data using google colab and get stuck at this phase
%cd /content/drive/My Drive/darknet !./darknet detector train data/obj.data cfg/yolov3-obj.cfg darknet53.conv.74
/content/drive/My Drive/darknet /bin/bash: ./darknet: No such file or directory
One more question, the level (txt file) of every image that wants to be trained, does it need to include in the same file as images?
Hello how did you fix this
Hi @mukiralad how did solve the problem
I used !./darknet detector train data/obj.data cfg/yolov3-obj.cfg darknet53.conv.74 for training my custom dataset and it was working fine but recently I'm getting /bin/bash: ./darknet: No such file or directory error. Ps:- I haven't changed anything in the code. Can anyone help me to fix this?
I used !./darknet detector train data/obj.data cfg/yolov3-obj.cfg darknet53.conv.74 for training my custom dataset and it was working fine but recently I'm getting /bin/bash: ./darknet: No such file or directory error. Ps:- I haven't changed anything in the code. Can anyone help me to fix this?
did you get any fix coz im also facing the same problem
Hi!
I think you get /bin/bash: ./darknet because you don't have your folder darknet place it there. Try to look where is the folder darknet and change the directory.
Hope this helps!
Regards
Hi guys , I faced same problem and using !./darknet/darknet fixed my issue .So you should try use !./darknet/darknet or !./content/darknet.
I hope it works .
Im still facing the problem. Can someone help please...
Colab cant see your files because of your paths . You should describe your paths like I did in here . I hope this way will solve your problem .
Colab cant see your files because of your paths . You should describe your paths like I did in here . I hope this way will solve your problem .
I solved that problem by converting my images file from jpeg to png https://user-images.githubusercontent.com/66896628/105391417-1f6f9200-5c40-11eb-9ea7-4582b7a94a2e.png but got a new error
It is possible that you just don't have a darknet file(you have to have darknet file inside the darknet folder). So just go to the darknet folder and run 'make', so the makefile will be executed and you will get your darknet file.
Thanks alot dude
On Fri, 19 Mar 2021, 7:06 pm Ubingazhibov, @.***> wrote:
I had the same problem, in my case i just didn't have darknet file(you have to have darknet file inside darknet folder). So just go to the darknet folder and run 'make', so makefile will be executed and you will get your darknet file.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/2090#issuecomment-802838062, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6MF5G5VTHKUPYVHDD4LBTTENHO7ANCNFSM4LVSZDOQ .
I ran the make file but it seems that is is giving me some error like below -
The complete error line is veryy long.
"gcc -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -shared obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/iseg_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/deconvolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/avgpool_layer_kernels.o -o libdarknet.so -lm -pthread pkg-config --libs opencv
-lstdc++ -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lcudnn -lstdc++
ar rcs libdarknet.a obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/iseg_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/deconvolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/avgpool_layerkernels.o
gcc -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv
-DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/captcha.c -o obj/captcha.o
gcc -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv
-DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/lsd.c -o obj/lsd.o
gcc -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv
-DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/super.c -o obj/super.o"
Kindly suggest what does that mean and how to resolve this error?
+1. такая же ошибка
Я запустил файл make, но кажется, что это дает мне некоторую ошибку, как показано ниже -
Полная строка ошибки очень длинная. "gcc -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -shared obj / gemm.o obj / utils.o obj / cuda.o obj / deconvolutional_layer .o obj / convolutional_layer.o obj / list.o obj / image.o obj / activations.o obj / im2col.o obj / col2im.o obj / blas.o obj / crop_layer.o obj / dropout_layer.o obj / maxpool_layer .o obj / softmax_layer.o obj / data.o obj / matrix.o obj / network.o obj / connected_layer.o obj / cost_layer.o obj / parser.o obj / option_list.o obj / detection_layer.o obj / route_layer .o obj / upsample_layer.o obj / box.o obj / normalization_layer.o obj / avgpool_layer.o obj / layer.o obj / local_layer.o obj / shortcut_layer.o obj / logistic_layer.o obj / activate_layer.o obj / rnn_layer .o obj / gru_layer.o obj / crnn_layer.o obj / demo.o obj / batchnorm_layer.o obj / region_layer.o obj / reorg_layer.o obj / tree.o obj / lstm_layer.o obj / l2norm_layer.o obj / yolo_layer .o obj / iseg_layer.o obj / image_opencv.o obj / convolutional_kernels.o obj / deconvolutional_kernels.o obj / activation_kernels.o obj / im2col_kernels.o obj / col2im_kernels.o obj / blas_kernels.o obj / blas_kernels.o obj / blas_kernels.o obj / blas_kernels.o obj. o obj / maxpool_layer_kernels.o obj / avgpool_layer_kernels.o -o libdarknet.so -lm -pthread
pkg-config --libs opencv
-lstdc ++ -L / usr / local / cuda / lib64 -lcuda -lcudart -lcublas -lcurand -lcudnn -lstdc ++ ar rcs libdarknet.a obj / gemm.o obj / utils.o obj / cuda.o obj / deconvolutional_layer.o obj / convolutional_layer.o obj / list.o obj / image.o obj / activations.o obj / im2col.o obj / col2im.o obj / blas.o obj / crop_layer.o obj / dropout_layer.o obj / maxpool_layer.o obj / softmax_layer.o obj / data.o obj / matrix.o obj / network.o obj / connected_layer.o obj / cost_layer.o obj / parser.o obj / option_list.o obj / detect_layer.o obj / route_layer.o obj / upsample_layer.o obj / box.o obj / normalization_layer.o obj / avgpool_layer.o obj / layer.o obj / local_layer.o obj / shortcut_layer.o obj / logistic_layer.o obj / activate_layer.o obj / rnn_layer.o obj / gru_layer.o obj / crnn_layer.o obj / demo.o obj / batchnorm_layer.o obj / region_layer.o obj / reorg_layer.o obj / tree.o obj / lstm_layer.o obj / l2norm_layer.o obj / yolo_layer.o obj / iseg_layer.o obj / image_opencv.o obj / convolutional_kernels.o obj / deconvolutional_kernels.o obj / activate_kernels.o obj / im2col_kernels.o obj / col2im_kernels.o obj / blas_kernels.o obj / crop_layer_kernels.o obj / dropout_layer_kernels.o obj / maxpool_layer_kernels.o obj / avgpoollayer gcc -Iinclude / -Isrc / -DOPENCVpkg-config --cflags opencv
-DGPU -I / usr / local / cuda / include / -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/captcha.c -o obj / captcha.o gcc -Iinclude / -Isrc / -DOPENCVpkg-config --cflags opencv
-DGPU -I / usr / local / cuda / include / -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/lsd.c -o obj / lsd.o gcc -Iinclude / -Isrc / -DOPENCVpkg-config --cflags opencv
-DGPU -I / usr / local / cuda / include / -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/super.c -o obj /super.o "Пожалуйста, подскажите, что это означает и как устранить эту ошибку?
I'm not sure if this is the right solution, but after I downgraded the CUDA version from v11 to v10 the code is worked. This is the code I used to setup the CUDA environment before train:
!apt-get --purge remove cuda nvidia libnvidia- !dpkg -l | grep cuda- | awk '{print $2}' | xargs -n1 dpkg --purge !apt-get remove cuda-* !apt autoremove !apt-get update
!wget --no-clobber https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb !sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub !apt-get update !apt-get install cuda-10-0
I got this code from this link: https://stackoverflow.com/a/66441116/9849809
If you see the link here, http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ it said that GPU k-80 is deprecated from CUDA 11, and sometime when we use GPU on Colab it will using GPU k-80. I think that's why the code has problem.
O código não está executando: !./darknet detector train data/obj.data cfg/yolov4_custom.cfg yolov4.conv.137 -dont_show -map aparece essa mensagem quando eu executo: /bin/bash: line 1: ./darknet: No such file or directory como resolvo isso?
can anyone tell me if he found solution to this problem: /bin/bash: line 1: ./darknet: Is a directory thanks in advance
Hi, still having this problem
did any one solve it ? plz share with us
I want to train my own custom data using google colab and get stuck at this phase
One more question, the level (txt file) of every image that wants to be trained, does it need to include in the same file as images?