Samay Lakhani
Samay Lakhani

Reputation: 125

/bin/bash: ./darknet: Permission denied

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?

Upvotes: 1

Views: 11360

Answers (6)

mech iyad
mech iyad

Reputation: 11

compile the darknet using the make function

!make

and don't forget to change the makefile

GPU=1
CUDNN=1
OPENCV=1

Upvotes: 0

Ganesh Rohan
Ganesh Rohan

Reputation: 31

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

Upvotes: 2

Siddharth Sankhe
Siddharth Sankhe

Reputation: 23

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.

Upvotes: 1

Manan
Manan

Reputation: 434

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.

Upvotes: 2

Trung Hoang Nguyen
Trung Hoang Nguyen

Reputation: 66

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

Upvotes: 5

paltaa
paltaa

Reputation: 3254

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

Upvotes: 1

Related Questions