yolo-windows icon indicating copy to clipboard operation
yolo-windows copied to clipboard

Yolo returns uniformly placed detections (bboxes) with almost equal confidence.

Open rap9430 opened this issue 8 years ago • 22 comments

Darknet compiles and runs correctly under window, but the yolo's result is not rational (see attached image). Is this a known issue? thanks. predictions

rap9430 avatar Mar 03 '16 01:03 rap9430

I get the samilar result, someone in the google group argue that maybe caused by the file read mode 'r' and 'rb' difference between linux and windows, but i try it and cannot make it work. btw: let me know if you make it works.

tanger830 avatar Mar 15 '16 14:03 tanger830

Yes, that didn't work for me too.

rap9430 avatar Mar 16 '16 12:03 rap9430

I find the problem, this is because the yolo.weights and yolo.cfg you download is up to date,but loading code in this project is out of date, so it cannot recognize some field name defined in yolo.cfg and just ignore it, this is the beginning of wrong weight load.

tanger830 avatar Mar 27 '16 11:03 tanger830

Hm... Did you find a solution, too? If yes, then could you please share it with us?

rap9430 avatar Mar 28 '16 09:03 rap9430

Hi, i also encountered the problem above. what i want to ask is that is there any hint or instruction on how to compile this project on windows? if we learned this method.so maybe we could create yolo-windows ourselves

zhangxuzju avatar Apr 01 '16 06:04 zhangxuzju

@2LOVES7 @rap9430

Hi, you can try this fork: https://github.com/AlexeyAB/yolo-windows

I've just got this result on Windows 7 x64 with yolo.cfg from my fork and yolo.weights from here: http://pjreddie.com/media/files/yolo.weights

predictions

AlexeyAB avatar Apr 20 '16 22:04 AlexeyAB

@AlexeyAB

Thanks! It works like charm. :D

rap9430 avatar Apr 22 '16 10:04 rap9430

@AlexeyAB

Can I compile your version of yolo using Visual Studio 2012?

I tried with VS2012 and I have changed include and library paths to my opencv 3.0.0 and CUDA 7.5.

I am getting linkage errors:

1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\limits(80): error : this declaration may not have extern "C" linkage

this and many more like this for avgpool_layer_kernels.cu

abhigarg avatar Jun 20 '16 03:06 abhigarg

@abhigarg

It can't be compiled using MSVS 2012 (v110) without code changes, because MSVS 2012 uses C89 standard of C, then must be declaring/initializing all local variables at the beginning of a code block (directly after an opening brace { ): http://stackoverflow.com/a/9903698/1558037

Otherwise there will be a lot of errors in lines like this: https://github.com/AlexeyAB/yolo-windows/blob/0bbef8e57ebd2d77d5ee46ed43e98db0c48c4cba/src/avgpool_layer.c#L8

About C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\limits(80): error : this declaration may not have extern "C" linkage perhaps this error is related to compile with OpenCV 3.0, and maybe this will help you: https://groups.google.com/forum/#!searchin/darknet/opencv$203/darknet/AfZcD-C6yXY/RWp5V2tXBAAJ

AlexeyAB avatar Jun 20 '16 14:06 AlexeyAB

Is anyone succeeded in training YOLO over windows ? (the test is working but the output weight file from training is not detecting anything)

if so, could you please refer to that Fork?

anas-899 avatar Aug 25 '16 05:08 anas-899

the training was working but the trained weights file have some issues. It can not be re-used for further training. I cant remember if it was working for test. I think I used this fork only.

On Thu 25 Aug, 2016, 11:23 anas-899, [email protected] wrote:

Is anyone succeeded in training YOLO over windows ? the test is working but the training is not.

if so, could you please refer to that Fork?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/frischzenger/yolo-windows/issues/1#issuecomment-242287591, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiH_N7ZmwjU2o0QV_ukF0mpX-Cjp9g7ks5qjS3PgaJpZM4HoBZe .

abhigarg avatar Aug 25 '16 05:08 abhigarg

@abhigarg yes, I also finished the training successfully but the output weight file is not detecting anything when I made that train on windows. that's why I think there is a problem by training over the windows.

anas-899 avatar Aug 25 '16 06:08 anas-899

I feel it has something to do with the way file is being written over windows. Most probably there is something wrong happening there. I remember trying different forks for different MSVC 2012, 2013, 2015 and all were giving same problem for training.

On Thu 25 Aug, 2016, 11:31 anas-899, [email protected] wrote:

@abhigarg https://github.com/abhigarg yes, I also finished the training successfully but the output weight file is not detecting anything when I made that train on windows. that's why I think there is a problem by training over the windows.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/frischzenger/yolo-windows/issues/1#issuecomment-242288723, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiH_FgsEZHVGT1JBG07LhteU0DuKpabks5qjS_OgaJpZM4HoBZe .

abhigarg avatar Aug 25 '16 06:08 abhigarg

@abhigarg I solved the saving weight issue. It needs to change in @AlexeyAB fork in two position (https://github.com/AlexeyAB/yolo-windows) : first: src/parser.c you should change the line FILE *fp = fopen(filename, "w"); to FILE *fp = fopen(filename, "wb");

second: src/utils.c you should change the line if(c==' '||c=='\t'||c=='\n') ++offset; to if(c==' '||c=='\t'||c=='\n'||c=='\r') ++offset;

then the training on windows will save the weight correctly.

anas-899 avatar Aug 26 '16 05:08 anas-899

thanks a lot .. I knew it would be somewhere there but could not find the time to look into it.

I will try these changes and see at my end.

On Fri 26 Aug, 2016, 11:23 anas-899, [email protected] wrote:

@abhigarg https://github.com/abhigarg I solved the saving weight issue. It needs to change in AlexeyAB fork in two position ( https://github.com/AlexeyAB/yolo-windows) : first: src/parser.c you should change the line FILE *fp = fopen(filename, "w"); to FILE *fp = fopen(filename, "wb");

second: src/utils.c you should change the line if(c==' '||c=='\t'||c=='\n') ++offset; to if(c==' '||c=='\t'||c=='\n'||c=='\r') ++offset;

then the training on windows will save the weight correctly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/frischzenger/yolo-windows/issues/1#issuecomment-242636758, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiH_C4-4l2VKpx3tZJrgxKmYi6VtlZZks5qjn9mgaJpZM4HoBZe .

abhigarg avatar Aug 26 '16 05:08 abhigarg

Hi, i tried both of them but no success, on the @AlexeyAB fork when i try to open the solution i get "One or more projects in the solution were not loaded correctly" actually i get this on both solutions, so I tried to compile the source by myself (just adding all the files on the src folder to an empty project) and got errors with the files "old.c" and "server.c" so I deleted them to see what happens, it compiles succesfully, and when running with both cfg files and weights I get the weird results as @rap9430 or just a colored image, yellow or green rectangle.. does anyone experiences the same error or has some idea what I might be doing wrong? greeeetz and thaaanks!

richipower avatar Nov 29 '16 14:11 richipower

@richipower What version of MSVS, CUDA and OpenCV do you use?

  • I also added description "Hot to compile": https://github.com/AlexeyAB/yolo-windows#how-to-compile
  • And I changed links to successfully tested weight-files for this version of Yolo: https://github.com/AlexeyAB/yolo-windows#pre-trained-models-for-different-cfg-files-can-be-downloaded-from-smaller---faster--lower-quality

AlexeyAB avatar Nov 30 '16 21:11 AlexeyAB

hello, @AlexeyAB and thank you for your very fast answer, i was trying this past days.. i am using MSVS 2015, CUDA 8, Opencv 2.4.13, still no success, (now trying v2) compiles succesfully (excluding CUDA and OpenCV) but maybe i am reading the wrong cfg/weight files(?), I tested with the documents provided from: https://github.com/AlexeyAB/darknet and downloaded the weights also from there, the problem now is that there are no predictions, even with threshold as zero.. I did the same procedure with the version 1 (MSVS_2013) also from your fork and it succesfully worked, with the given weights and cfg´s :-) do you have maybe an idea what can be going wrong here with the v2? greetz and thaaanks!

richipower avatar Dec 05 '16 10:12 richipower

@richipower Try to compile Yolo v2 with CUDA+OpenCV and run on video-file.

About Yolo v2:

  • Currently detection on image doesn't work propertly: darknet.exe yolo test yolo-voc.cfg yolo-voc.weights air7.jpg -i 0 -thresh 0.01
  • But detection on video-files (with OpenCV) works successfully: darknet.exe yolo demo yolo-voc.cfg yolo-voc.weights test.mp4 -i 0
  • Can be compiled by using: MSVS2015 or MSVS 2013 (12.0.40629.00 update 5)

About Yolo v1: now it works propertly only on MSVS2013.

AlexeyAB avatar Dec 05 '16 11:12 AlexeyAB

@richipower

After the update the latest changes you can use this in Yolo v2:

To detection on image-file:

  • 256 MB COCO-model - image: darknet.exe detector test data/coco.data yolo.cfg yolo.weights -i 0 -thresh 0.2
  • 256 MB VOC-model - image: darknet.exe detector test data/voc.data yolo-voc.cfg yolo-voc.weights -i 0

To detection on video-file:

  • 256 MB COCO-model - video: darknet.exe detector demo data/coco.data yolo.cfg yolo.weights test.mp4 -i 0
  • 256 MB VOC-model - video: darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4 -i 0

AlexeyAB avatar Dec 06 '16 12:12 AlexeyAB

hello! I was testing with the video files, everything works flawless. Now I will check with the images, thank you for your support! :-)

richipower avatar Dec 06 '16 12:12 richipower

Current Yolo version 2 for Windows tested for custom training & detection: https://github.com/AlexeyAB/darknet

AlexeyAB avatar Jan 18 '17 10:01 AlexeyAB