darknet icon indicating copy to clipboard operation
darknet copied to clipboard

data/coco.names

Open adityaparida opened this issue 7 years ago • 26 comments

unable to open coco.names file if there is any solution for it then resolve this please.

adityaparida avatar May 22 '18 18:05 adityaparida

When I execute the following command, I have the same problem. ./darknet detect cfg/yolov3.cfg weight/yolov3.weights data/dog.jpg Couldn't open file: data/coco.names

qtz93 avatar Jun 02 '18 11:06 qtz93

Did anyone find out the solution to this problem?

PranjalBiswas avatar Jul 12 '18 16:07 PranjalBiswas

At first I also encountered this problem. But, I download the darknet again, compiled, there is no this problem.

sniper-for-14 avatar Jul 20 '18 07:07 sniper-for-14

maybe because of line break.I download zip file,and unzip,compile(on windows). there is no this problem.

xiahaoyun avatar Aug 06 '18 06:08 xiahaoyun

Thank you. Downloading zip file solved this problem

Vanchez23 avatar Aug 28 '18 22:08 Vanchez23

      Thank you. Downloading zip file solved this problem

What is the zip file? I have met the same question.

xiayq1 avatar Oct 30 '18 09:10 xiayq1

I happened to have same problem but the cause was that I prepared cfg/obj.data on windows machine but was run on linux machine.

When I converted file dos2unix cfg/obj.data everything started to work

xslavkov avatar Nov 19 '18 14:11 xslavkov

I am facing the same issue:

Couldn't open file: /data/coco.names

I did even download the zipped file again but facing the same error. Could you please help

shrybht avatar Dec 17 '18 21:12 shrybht

Hello, This problem can be solved by changing the path of coco.names file in coco.data file.

classes= 80 train = /home/pjreddie/data/coco/trainvalno5k.txt valid = coco_testdev #valid = data/coco_val_5k.list names = ../data/coco.names backup = /home/pjreddie/backup/ eval=coco

Thanks

himanshu9345 avatar Jan 12 '19 03:01 himanshu9345

I use Windows Subsystem For Linux on Windows 10. In my case I cloned repo in Windows but tried to run darknet in Linux. It fails due to different format of line endings (CRLF in Win and LF in Linux). So I just forcibly checked out it again in bash: git checkout --force. Be warned that this will revert your config changes if any.

vzverev78 avatar Jan 20 '19 17:01 vzverev78

hi guys you should download zip file or immediately use git clone in ubuntu os . You shouldn't paste the file from windows to ubuntu os,for the file will become txt file.

hackjus avatar Mar 26 '19 12:03 hackjus

hi guys you should download zip file or immediately use git clone in ubuntu os . You shouldn't paste the file from windows to ubuntu os,for the file will become txt file.

I copy the project from windows to ubuntu os, then this question occured!Change the the path of coco.names file can not solve it. But use git clone in ubuntu os without this problem!So weird!

tuuzhang avatar Apr 17 '19 08:04 tuuzhang

@tuuzhang, follow instruction from @himanshu9345, edit the coco.data files. you will find the names variable that you need to change.

change it to your coco.names folder and file exists in my case: names= D:/core/darknetAB/data/coco.names

wahyubram82 avatar Apr 27 '19 19:04 wahyubram82

@wahyubram82 ok, got it, thanks for your reply!

tuuzhang avatar Apr 30 '19 09:04 tuuzhang

You can bring darknet.py in darknet/python into directory darknet/ to solve it. Before, you changed absolute path for libdarknet.so, load_net, load_meta, detect (also add b"path")

hieudoan7 avatar May 14 '19 03:05 hieudoan7

This solution worked for me: https://github.com/pjreddie/darknet/issues/147#issue-251128346

If you are using Windows, the dos2unix.exe is found in your Git's directory: usr/bin Run that dos2unix.exe in cmd and use it to convert the files in the link I attached.

Then, go to darknet folder, delete the darknet.exe and run the command make again (in what ever way you did this). This generates a new darknet.exe file

Open cmd as administrator, then put the following command: C:\[directory of your darknet folder]> .\darknet.exe detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

aparico avatar Jun 05 '19 08:06 aparico

Hello, This problem can be solved by changing the path of coco.names file in coco.data file.

classes= 80 train = /home/pjreddie/data/coco/trainvalno5k.txt valid = coco_testdev #valid = data/coco_val_5k.list names = ../data/coco.names backup = /home/pjreddie/backup/ eval=coco

Thanks

That really makes sense.

xzhws avatar Oct 04 '19 14:10 xzhws

I happened to have same problem but the cause was that I prepared cfg/obj.data on windows machine but was run on linux machine.

When I converted file dos2unix cfg/obj.data everything started to work

Can do this

dos2unix cfg/coco.data dos2unix data/coco.names

That really makes sense.

anewyee avatar Oct 24 '19 08:10 anewyee

I have solved this issue as below: 1: cd to "darknet" folder. >> cd darknet 2. allow full permission for all file in the darknet folder. >> sudo chmod -R 777 *

Hope this help.

binhdv92 avatar Nov 28 '19 13:11 binhdv92

Git clone it in ubuntu os. This question will not occur.

XlDerek avatar Nov 29 '19 11:11 XlDerek

Hello, This problem can be solved by changing the path of coco.names file in coco.data file.

classes= 80 train = /home/pjreddie/data/coco/trainvalno5k.txt valid = coco_testdev #valid = data/coco_val_5k.list names = ../data/coco.names backup = /home/pjreddie/backup/ eval=coco

Thanks

For me, this file was inside /darknet/cfg/coco.data instead of the path listed above. It seems that pjreddie's personal path is harcoded into the coco.data file (or maybe I made a mistake somewhere). Changing it through this directory solved the problem for me.

perturbedmuffin avatar Feb 13 '20 18:02 perturbedmuffin

The reason for that is the path to coco.names is not mentioned in the misc.py file.

In your darkflow directory, navigate to the following file: \darkflow\darkflow\net\yolo\misc.py

You can open and edit the .py file with IDLE

InkedCapture_LI

Change the file path. Save the misc.py and run your program again!

thekaranvarma avatar Sep 30 '20 19:09 thekaranvarma

Hello, This problem can be solved by changing the path of coco.names file in coco.data file.

classes= 80 train = /home/pjreddie/data/coco/trainvalno5k.txt valid = coco_testdev #valid = data/coco_val_5k.list names = ../data/coco.names backup = /home/pjreddie/backup/ eval=coco

Thanks

Even with these modifications I still get the same error "Couldn't open file: ../data/coco.names"

Stylos21 avatar Apr 04 '21 00:04 Stylos21

Nevermind, my project directory had spaces, so this was solved by removing them 😛

Stylos21 avatar Apr 04 '21 01:04 Stylos21

I had the same issue as to OP for FreeBSD. I have compiled a GitHub project which implements darknet yolo for AMD GPUs: https://github.com/sowson/darknet

Which is a fork for this repo.

I followed the solution provided from: himanshu9345

In which I appended the ../ prefix notation at the beginning for: names = data/coco.names.

I edited the coco.data file located at: /usr/home/user/darknet/cfg/coco.data

From:

classes= 80
train  = /home/pjreddie/data/coco/trainvalno5k.txt
valid  = coco_testdev
#valid = data/coco_val_5k.list
names = data/coco.names
backup = /home/pjreddie/backup/
eval=coco

To:

classes= 80 
train = /home/pjreddie/data/coco/trainvalno5k.txt 
valid = coco_testdev 
#valid = data/coco_val_5k.list 
names = ../data/coco.names 
backup = /home/pjreddie/backup/ 
eval=coco

Would also like to point out that for me, I need to provide full paths when running darknet for the .data, .cfg, .weights and .jpg files:

$ ./darknet detect /usr/home/user/darknet/cfg/coco.data /usr/home/user/darknet/cfg/yolov3.cfg /usr/home/user/darknet/weights/yolov3.weights /home/user/darknet/data/dog.jpg

If I do not use full paths, I get errors.

This solved for me.

Thanks.

rajhlinux avatar Oct 11 '22 04:10 rajhlinux

I had the same issue. Please add the extension .txt

open(r'C:\Users........\coco.names.txt', "r")

hamzakh23 avatar Apr 24 '23 13:04 hamzakh23