I tried to train the custom object according to https://www.youtube.com/watch?v=mmj3nxGT2YQ&t=1747s. In the training part when i run this code on my colab

!./darknet detector train data/obj.data cfg/yolov4-obj.cfg yolov4.conv.137 -dont_show -map

I get errors like:

/bin/bash: ./darknet: No such file or /bin/bash: ./darknet: Is a directory

What shoul i do?

6

There are 6 best solutions below

0
On

I had the same problem, I used "pwd" just before to run that line, I noticed that i was in a diferent directory (I was out Darknet folder). So I changed folder path with "cd" to go to darknest folder an run the line again.

0
On

run !make before running the command (for colab)

0
On

For Roboflow Colab Notebook :

Change git clone command and Clone AlexeyAB darknet repository :

!git clone https://github.com/AlexeyAB/darknet.git
0
On

The following steps are to be followed for custom object detection training with Yolo on colab:

# clone darknet from github to create a darknet folder inside /content on colab
!pwd
# /content/darknet
!make
# modify Yolo cfg, copy images etc. and make the training data ready
!pwd
# /content/darknet
# now train
!./darknet detector train data/obj.data cfg/yolov4-obj.cfg yolov4.conv.137 -dont_show -map
0
On

Ignore all the cells before the heading:"Installing Darknet for YOLOv4 on Colab" then run the following cell and then you can proceed to the end

"""

# clone darknet repo
!git clone https://github.com/AlexeyAB/darknet


# change makefile to have GPU and OPENCV enabled
%cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/' Makefile
!sed -i 's/GPU=0/GPU=1/' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/' Makefile
!sed -i 's/CUDNN_HALF=0/CUDNN_HALF=1/' Makefile

# CUDA: Let's check that Nvidia CUDA drivers are already pre-installed and which version is it.
!/usr/local/cuda/bin/nvcc --version
# We need to install the correct cuDNN according to this output

!make

"""

0
On

Roboflow colab Notebook: Instead of using roboflow darknet git you may replace it with AlexeyAB darknet git. Honestly this moves saved my time. If you work with unchaged git of robflow to train your model on custom data you should replace it.