1

I've created an object detection model using Roboflow's tutorial and have all the saved weights. The one problem I have is deploying it in a Google Colaboratory. I've changed up some code, but it does not seem to work. So in short, model's trained.

How do I use the model in another Google Colaboratory? I've downloaded the whole darknet folder to the environment with a direct download, some plotting functions and then ran:

and then

!./darknet detect cfg/custom-yolov4-detector.cfg backup/custom-yolov4-detector_last.weights {img} #-dont-show

Only to get:

/bin/bash: ./darknet: Permission denied

Any suggestions?

Brad Dwyer
  • 6,305
  • 8
  • 48
  • 68
Samay Lakhani
  • 85
  • 1
  • 1
  • 7
  • Is darknet executable? Try running `chmod a+x darknet` from the directory containing the file "darknet". Note: this will make the file executable to all users. If you only want the owning user or group to be able to execute the file, supply the relevant arguments to `chmod`. – Alexander Guyer Aug 08 '20 at 23:21

6 Answers6

5

Just add this before your command: !chmod +x ./darknet

Salma Elshahawy
  • 1,112
  • 2
  • 11
  • 21
  • As there is a slight difference with other answer given you need to provide more context to improve its quality. – ZF007 Oct 19 '20 at 14:31
  • 1
    There is a small hack in my case , first run !chmod +x ./darknet . now it will show error but now delete !chmod +x and run as normal again !./darknet – Satish Saini Jun 15 '21 at 03:40
2

In step 4 of this tutorial you will find the command !chmod +x ./darknet. Depending on your directory, you may need to run !chmod +x ./darknet/darknet. It depends on your folder structure. Worked for me.

Manan
  • 394
  • 4
  • 15
2

need to re-run the darknet !make file

%cd /your_path/
!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= ${ARCH_VALUE}/g" Makefile
!make
1

you are lacking execution permission for that script, you need to do chmod +x darknet

paltaa
  • 2,985
  • 13
  • 28
1

If your files are already compiled using !make command, then use !chmod +x ./darknet/darknet or else first compile it and then use !chmod +x ./darknet/darknet

If it still doesn't work, delete the entire darknet package and then clone it again.

Ruli
  • 2,592
  • 12
  • 30
  • 40
0

compile the darknet using the make function

!make

and don't forget to change the makefile

GPU=1
CUDNN=1
OPENCV=1
mech iyad
  • 23
  • 6