darknet icon indicating copy to clipboard operation
darknet copied to clipboard

Couldn't open file:/backup//yolo-obj_100.weights

Open vvkv opened this issue 7 years ago • 41 comments

I am training my yolo network on an ubuntu machine, and the training seems to go well for the first 100 steps after which it gets aborted with the error: "Couldn't open file:/backup//yolo-obj_100.weights"

Here is the terminal output for reference:

ubuntu@ip-172-31-40-216:~/darknet$ ./darknet detector train cfg/obj.names cfg/yolo-obj.cfg\ darknet19_448.conv.23 train: Using default 'data/train.list' backup: Using default '/backup/' yolo-obj layer filters size input output 0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32 2 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 3 max 2 x 2 / 2 208 x 208 x 64 -> 104 x 104 x 64 4 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 5 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 6 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 7 max 2 x 2 / 2 104 x 104 x 128 -> 52 x 52 x 128 8 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 9 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 10 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 11 max 2 x 2 / 2 52 x 52 x 256 -> 26 x 26 x 256 12 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 13 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 14 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 15 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 16 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 17 max 2 x 2 / 2 26 x 26 x 512 -> 13 x 13 x 512 18 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 19 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 20 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 21 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 22 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 23 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 24 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 25 route 16 26 reorg / 2 26 x 26 x 512 -> 13 x 13 x2048 27 route 26 24 28 conv 35 3 x 3 / 1 13 x 13 x3072 -> 13 x 13 x 35 29 conv 35 1 x 1 / 1 13 x 13 x 35 -> 13 x 13 x 35 30 detection Loading weights from darknet19_448.conv.23... seen 32 Done! Learning Rate: 0.0001, Momentum: 0.9, Decay: 0.0005 Loaded: 1.204687 seconds Region Avg IOU: 0.327445, Class: 0.507517, Obj: 0.602026, No Obj: 0.534384, Avg Recall: 0.125000, count: 8 Region Avg IOU: 0.373777, Class: 0.478211, Obj: 0.561162, No Obj: 0.535185, Avg Recall: 0.375000, count: 8 Region Avg IOU: 0.214813, Class: 0.614562, Obj: 0.524953, No Obj: 0.534205, Avg Recall: 0.000000, count: 8 Region Avg IOU: 0.314540, Class: 0.647449, Obj: 0.504414, No Obj: 0.535127, Avg Recall: 0.250000, count: 8 Region Avg IOU: 0.286844, Class: 0.568035, Obj: 0.508885, No Obj: 0.533469, Avg Recall: 0.250000, count: 8 Region Avg IOU: 0.214517, Class: 0.626371, Obj: 0.443656, No Obj: 0.534725, Avg Recall: 0.000000, count: 8 . . . . Region Avg IOU: 0.660878, Class: 0.873684, Obj: 0.239481, No Obj: 0.060791, Avg Recall: 1.000000, count: 8 Region Avg IOU: 0.702378, Class: 0.806532, Obj: 0.313847, No Obj: 0.060674, Avg Recall: 1.000000, count: 8 100: 0.368687, 0.404861 avg, 0.001000 rate, 7.345735 seconds, 6400 images Saving weights to /backup//yolo-obj_100.weights Couldn't open file: /backup//yolo-obj_100.weights

Why is this happening? I have the backup folder created at the same directory level as the darknet exe, so, darknet/backup, and the folder is empty.

Any guidance will be very useful

vvkv avatar Jan 16 '18 19:01 vvkv

Manully create the 'backup' folder and retrain.

Li-Lai avatar Jan 17 '18 00:01 Li-Lai

I ran into the same problem. go to your /cfg/yolo.data file and make sure you have a line that says backup = backup

(not backup = backup/) the code will append "/theweightsfile.weights" to this directory and you'll have double slashes.

Good luck.

tgwagner avatar Jan 20 '18 05:01 tgwagner

just had the same problem.

although:

  • my "backup" folder existed
  • the line in /cfg/yolo.data was "backup = backup"

turned out it was a stupid mistake on my side: I was executing the command from my "C:\Users\micha" directory, instead of the correct "C:\users\micha....\darknet-master".

HTH, Michael

michaelfuchs1 avatar May 31 '18 05:05 michaelfuchs1

I have the same issue. Where you able to solve it?

GioLomia avatar Jun 20 '19 15:06 GioLomia

I have the same issue. Where you able to solve it?

Just remove the backup folder and create a new one

lsd1994 avatar Jun 21 '19 00:06 lsd1994

I have the same issue. Where you able to solve it?

Just remove the backup folder and create a new one

I did but it still did not work

GioLomia avatar Jun 21 '19 14:06 GioLomia

having the same issue, even after recreating the backup folder. any tips are really appreciated

hemanthkumar3111 avatar Jul 02 '19 11:07 hemanthkumar3111

The problem is the leading / which means that the path refers to a directory named backup and located at the root of the machine. Which most certainly does not exist on your machine…

Unlike some have said, the problem is not the double / in /backup//yolo-obj_100.weights: at least in Linux, // is equivalent to /./. Actually I like setting backup = ./backup/ in the configuration file because I find it looks good and unambiguous, which in my case eventually expands as Saving weights to ./backup//yolo-obj_last.weights… And it works!

There can be three things that you are doing wrong:

  1. Your object data configuration file specifies a path that does not correspond to an actual directory.
  2. That directory exists, but you don't have the required permissions e.g. read-only directory.
  3. Your object data configuration file uses a key that is misspelled (e.g. bakup instead of backup). If so, darknet will use its default value: /backup/. (This was my case)

How to recognize whether you are in case #1, #2 or #3: If you are in case #3, darknet will display backup: Using default '/backup/' in one of the first lines of its prompt (in particular, before loading the network's configuration).

In case #1 or case #2: do as @CBIR-LL proposed: (i) delete existing directory and create a fresh one, then (ii) double check that the path you specified is indeed correct.

In case #3: fix your configuration file by changing the key name to an actual legal name e.g. backup instead of bakup. Assure yourself that you did it right by checking the absence of the backup: Using default '/backup/' line on your next run of darknet.

GLorieul avatar Sep 24 '19 20:09 GLorieul

The reason is because remember the darknet.exe program being run on cmd prompt needs all paths relative to it. For example, my backup folder was actually in the x64 folder. So I changed it to to x64/backup/ (the final slash is ok since it's opening that folder).

USNA2014 avatar Mar 25 '20 04:03 USNA2014

I ran into the same problem. go to your /cfg/yolo.data file and make sure you have a line that says backup = backup

(not backup = backup/) the code will append "/theweightsfile.weights" to this directory and you'll have double slashes.

Good luck.

worked for me, thanks

domhel avatar Mar 28 '20 13:03 domhel

@GLorieul Hi, I'm trying to run my model on google colab and gave by a backup path to a folder that I created in google colab but the model stops abruptly at 100th iteration.

Please help me out to solve this issue as I have been stuck with this issue for a week.

image

shouryasimha avatar Mar 28 '20 17:03 shouryasimha

I ran into the same problem. go to your /cfg/yolo.data file and make sure you have a line that says backup = backup

(not backup = backup/) the code will append "/theweightsfile.weights" to this directory and you'll have double slashes.

Good luck.

i got the same issue and was about to try your advise but i see theres no yolo.data file in cfg folder .

beipym avatar Apr 06 '20 10:04 beipym

@shouryasimha hello, can you say where your backup folder is relative to your darknet folder? This seems to be an issue of the program not able to find the backup folder. Sometimes darknet.exe ends abruptly without displaying an error.

USNA2014 avatar Apr 06 '20 17:04 USNA2014

It was solved by using sudo doc2unix. Can you help me to find a way to visualise the training results?

On Mon, Apr 6, 2020 at 1:12 PM GS [email protected] wrote:

@shouryasimha https://github.com/shouryasimha hello, can you say where your backup folder is relative to your darknet folder? This seems to be an issue of the program not able to find the backup folder. Sometimes darknet.exe ends abruptly without displaying an error.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/416#issuecomment-609922420, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2FYMVGZZYYIOEAYSMGDRLIEPDANCNFSM4EMBKEOQ .

shouryasimha avatar Apr 06 '20 17:04 shouryasimha

@shouryasimha also why is it yolov3.backup? Backup shouldn’t be a file extension and should be a folder. Like this yolov3/backup

USNA2014 avatar Apr 06 '20 17:04 USNA2014

Yolov3.backup is the weight corresponding to the latest weights wrt to the epochs , such as if your model stopped at 7123 iteration, using that yolov3.backup you can resume training from there . It’s helpful if you are running your model on colab or so , in case runtime gets disconnected

On Mon, Apr 6, 2020 at 1:14 PM GS [email protected] wrote:

@shouryasimha https://github.com/shouryasimha also why is it yolov3.backup? Backup shouldn’t be a file extension and should be a folder. Like this yolov3/backup

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/416#issuecomment-609923572, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2FZFJQC55VCLBDR2HKTRLIEXZANCNFSM4EMBKEOQ .

shouryasimha avatar Apr 06 '20 17:04 shouryasimha

Interesting, didn’t know that. Good to know.

USNA2014 avatar Apr 06 '20 17:04 USNA2014

Yolov3.backup is the weight corresponding to the latest weights wrt to the epochs , such as if your model stopped at 7123 iteration, using that yolov3.backup you can resume training from there . It’s helpful if you are running your model on colab or so , in case runtime gets disconnected On Mon, Apr 6, 2020 at 1:14 PM GS @.***> wrote: @shouryasimha https://github.com/shouryasimha also why is it yolov3.backup? Backup shouldn’t be a file extension and should be a folder. Like this yolov3/backup — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#416 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2FZFJQC55VCLBDR2HKTRLIEXZANCNFSM4EMBKEOQ .

Please how did you use the doc2unix to solve your problem. I did this, but its not working. %cd /content/darknet !dos2unix ./data/snowman_train.txt !dos2unix ./data/snowman_test.txt !dos2unix ./data/coco.data !dos2unix ./data/yolo.names !dos2unix ./cfg/yolo1.cfg !dos2unix ./backup

Javaworld22 avatar Apr 24 '20 11:04 Javaworld22

Please check the address of the backup file . If you are working on windows , convert the files using dos2unix . It will be helpful , if you could provide screenshots

On Fri, Apr 24, 2020 at 7:50 AM Javaworld22 [email protected] wrote:

Yolov3.backup is the weight corresponding to the latest weights wrt to the epochs , such as if your model stopped at 7123 iteration, using that yolov3.backup you can resume training from there . It’s helpful if you are running your model on colab or so , in case runtime gets disconnected … <#m_3307301866333555579_> On Mon, Apr 6, 2020 at 1:14 PM GS @.***> wrote: @shouryasimha https://github.com/shouryasimha https://github.com/shouryasimha also why is it yolov3.backup? Backup shouldn’t be a file extension and should be a folder. Like this yolov3/backup — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#416 (comment) https://github.com/pjreddie/darknet/issues/416#issuecomment-609923572>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2FZFJQC55VCLBDR2HKTRLIEXZANCNFSM4EMBKEOQ .

Please how did you use the doc2unix to solve your problem. I did this, but its not working. %cd /content/darknet !dos2unix ./data/snowman_train.txt !dos2unix ./data/snowman_test.txt !dos2unix ./data/coco.data !dos2unix ./data/yolo.names !dos2unix ./cfg/yolo1.cfg !dos2unix ./backup

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/416#issuecomment-618964379, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2F2I2LAH2RRXYQEF433ROF4JBANCNFSM4EMBKEOQ .

shouryasimha avatar Apr 24 '20 13:04 shouryasimha

Please check the address of the backup file . If you are working on windows , convert the files using dos2unix . It will be helpful , if you could provide screenshots On Fri, Apr 24, 2020 at 7:50 AM Javaworld22 [email protected] wrote: Yolov3.backup is the weight corresponding to the latest weights wrt to the epochs , such as if your model stopped at 7123 iteration, using that yolov3.backup you can resume training from there . It’s helpful if you are running your model on colab or so , in case runtime gets disconnected … <#m_3307301866333555579_> On Mon, Apr 6, 2020 at 1:14 PM GS @.***> wrote: @shouryasimha https://github.com/shouryasimha https://github.com/shouryasimha also why is it yolov3.backup? Backup shouldn’t be a file extension and should be a folder. Like this yolov3/backup — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#416 (comment) <#416 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2FZFJQC55VCLBDR2HKTRLIEXZANCNFSM4EMBKEOQ . Please how did you use the doc2unix to solve your problem. I did this, but its not working. %cd /content/darknet !dos2unix ./data/snowman_train.txt !dos2unix ./data/snowman_test.txt !dos2unix ./data/coco.data !dos2unix ./data/yolo.names !dos2unix ./cfg/yolo1.cfg !dos2unix ./backup — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#416 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2F2I2LAH2RRXYQEF433ROF4JBANCNFSM4EMBKEOQ .

Hello Sir. I just solved the problem now. whenever it reaches 100th iteration, it stops. Showing me this. image

I solved it by commenting this on my Google colab notebook

"!rm /content/darknet/backup -r" "!ln -s /content/drive/'My Drive'/YOLOv3_weight/backup /content/darknet"

This does the work of relocating my original folder to "/content/drive/'My Drive'/YOLOv3_weight/backup", hence rendering "/content/darknet/backup" invalid

I'm working on macos

Javaworld22 avatar Apr 24 '20 15:04 Javaworld22

You should run with sudo Run the command like this. ./darknet detector train cfg/obj.names cfg/yolo-obj.cfg\

this worked for me(ubuntu16).

temps1101 avatar Apr 25 '20 03:04 temps1101

First install dos2unix Please find my github repo , and you can your awnser there .

On Fri, Apr 24, 2020 at 11:37 PM temps1101 [email protected] wrote:

You should run with sudo Run the command like this. ./darknet detector train cfg/obj.names cfg/yolo-obj.cfg\

this worked for me(ubuntu16).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/416#issuecomment-619313529, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2F4UBMHLHWPEXTMCWPTROJLGJANCNFSM4EMBKEOQ .

shouryasimha avatar Apr 25 '20 05:04 shouryasimha

I ran into the same problem. go to your /cfg/yolo.data file and make sure you have a line that says backup = backup

(not backup = backup/) the code will append "/theweightsfile.weights" to this directory and you'll have double slashes.

Good luck.

image

FireHead90544 avatar Jul 08 '20 17:07 FireHead90544

I do not have any such file.

FireHead90544 avatar Jul 08 '20 17:07 FireHead90544

@GLorieul Hi, I'm trying to run my model on google colab and gave by a backup path to a folder that I created in google colab but the model stops abruptly at 100th iteration.

Please help me out to solve this issue as I have been stuck with this issue for a week.

image

I am running on Colab too and facing some issues.

FireHead90544 avatar Jul 08 '20 17:07 FireHead90544

I ran into the same problem. go to your /cfg/yolo.data file and make sure you have a line that says backup = backup (not backup = backup/) the code will append "/theweightsfile.weights" to this directory and you'll have double slashes. Good luck.

i got the same issue and was about to try your advise but i see theres no yolo.data file in cfg folder .

Yes.

FireHead90544 avatar Jul 08 '20 17:07 FireHead90544

I am training my yolo network on an ubuntu machine, and the training seems to go well for the first 100 steps after which it gets aborted with the error: "Couldn't open file:/backup//yolo-obj_100.weights"

Here is the terminal output for reference:

ubuntu@ip-172-31-40-216:~/darknet$ ./darknet detector train cfg/obj.names cfg/yolo-obj.cfg\ darknet19_448.conv.23 train: Using default 'data/train.list' backup: Using default '/backup/' yolo-obj layer filters size input output 0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32 2 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 3 max 2 x 2 / 2 208 x 208 x 64 -> 104 x 104 x 64 4 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 5 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 6 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 7 max 2 x 2 / 2 104 x 104 x 128 -> 52 x 52 x 128 8 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 9 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 10 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 11 max 2 x 2 / 2 52 x 52 x 256 -> 26 x 26 x 256 12 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 13 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 14 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 15 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 16 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 17 max 2 x 2 / 2 26 x 26 x 512 -> 13 x 13 x 512 18 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 19 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 20 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 21 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 22 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 23 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 24 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 25 route 16 26 reorg / 2 26 x 26 x 512 -> 13 x 13 x2048 27 route 26 24 28 conv 35 3 x 3 / 1 13 x 13 x3072 -> 13 x 13 x 35 29 conv 35 1 x 1 / 1 13 x 13 x 35 -> 13 x 13 x 35 30 detection Loading weights from darknet19_448.conv.23... seen 32 Done! Learning Rate: 0.0001, Momentum: 0.9, Decay: 0.0005 Loaded: 1.204687 seconds Region Avg IOU: 0.327445, Class: 0.507517, Obj: 0.602026, No Obj: 0.534384, Avg Recall: 0.125000, count: 8 Region Avg IOU: 0.373777, Class: 0.478211, Obj: 0.561162, No Obj: 0.535185, Avg Recall: 0.375000, count: 8 Region Avg IOU: 0.214813, Class: 0.614562, Obj: 0.524953, No Obj: 0.534205, Avg Recall: 0.000000, count: 8 Region Avg IOU: 0.314540, Class: 0.647449, Obj: 0.504414, No Obj: 0.535127, Avg Recall: 0.250000, count: 8 Region Avg IOU: 0.286844, Class: 0.568035, Obj: 0.508885, No Obj: 0.533469, Avg Recall: 0.250000, count: 8 Region Avg IOU: 0.214517, Class: 0.626371, Obj: 0.443656, No Obj: 0.534725, Avg Recall: 0.000000, count: 8 . . . . Region Avg IOU: 0.660878, Class: 0.873684, Obj: 0.239481, No Obj: 0.060791, Avg Recall: 1.000000, count: 8 Region Avg IOU: 0.702378, Class: 0.806532, Obj: 0.313847, No Obj: 0.060674, Avg Recall: 1.000000, count: 8 100: 0.368687, 0.404861 avg, 0.001000 rate, 7.345735 seconds, 6400 images Saving weights to /backup//yolo-obj_100.weights Couldn't open file: /backup//yolo-obj_100.weights

Why is this happening? I have the backup folder created at the same directory level as the darknet exe, so, darknet/backup, and the folder is empty.

Any guidance will be very useful

I had one problem too: Screenshot 2020-07-08 23 24 39 And I do not have an exact solution.

sj-on avatar Jul 08 '20 17:07 sj-on

I am running on Google Colab.

sj-on avatar Jul 08 '20 17:07 sj-on

Hello Sjon, If you could describe your problem more, I could help you. if you are working on colab convert your files using !dos2unix. Please check out my GitHub repo https://github.com/shouryasimha/darknet. Please read the read.me .P.S: I was working windows and google colab.

shouryasimha avatar Jul 10 '20 04:07 shouryasimha

Hello Sjon, If you could describe your problem more, I could help you. if you are working on colab convert your files using !dos2unix. Please check out my GitHub repo https://github.com/shouryasimha/darknet. Please read the read.me .P.S: I was working windows and google colab.

My Issue

sj-on avatar Jul 10 '20 05:07 sj-on