3
votes

I recently trained Yolo using the steps provided by https://github.com/AlexeyAB/darknet on Windows10 and had great results on the PC when using my custom training set. However, I am having issues deploying to a linux machine when running the command ./darknet detector test data/obj.data cfg/yolo-obj.cfg yolo-obj_25000.weights which returns:

Couldn't open file: data/obj.names

I've checked that the paths are correct, the files exist and I'm able to cat and return results on all files in their respective directories. I used relative paths and still had the same issue. Any insight on what I might be missing?

7
Does it work if you use predefined weights and name files in the same directories? If so, it's maybe just a file format problem, like line return difference between windows and linux..? - Eino Gourdin
encountered the same problem. did you fix it? - Parker

7 Answers

2
votes

I fixed this issue by replacing relative path to absolute path for names in obj.data file, i.e. from

names = data/obj.names`

to

names = C:/project/darknet/build/darknet/x64/data/obj.names

Not sure why I had this issue though, it was working previously with just the relative path.

1
votes

Just copy the obj.names file in the darknet parent directory (outside the cfg folder) and it worked for me. Note that this is the temporary solution and you need to fix that by changing paths appropriately.

0
votes

You can change file permissions like:

chmod 777 /content/darknet/cfg/obj.data
0
votes

I had to use 'dos2unix' to convert my ".names" file, there was no issue with path. After that for me it showed that I was missing some files from data/labels folder, which I had replaced with my custom training data set. So, I just pasted original labels files too in my new custom labels folder. It worked nicely after that. But, I'm not sure why it needed those labels file if I'm just testing. Also, those original label files weren't needed even during training.

0
votes

If by any chance you put the file name between "", then remove them. Notice that this will make impossible for you to have images files on folders with spaces on their names, so you should probably want to look into that too.

0
votes

I ran into this problem and the path I described was correct. I fixed this problem by renaming the file completely.

0
votes

in these type of cases mostly the path mentioned is incorrect, check you path again and it will get resolved