AlexeyAB / yolo-windows

a yolo windows version(for object detection)
71 stars 58 forks source link

Installation help #5

Closed olivesfang closed 7 years ago

olivesfang commented 7 years ago

I'm sorry, I'm relatively new to Visual Studio and am unsure of what steps I should take to compile. Is there a step by step guide? If not, currently I have CUDA 6.5 x64 installed (as well as 7.5) and OpenCV 2.4.9, and I'm trying to load the yolo-windows-master\build\darknet\darknet.sln with VS 2013, but to no luck.

C:\Users(username)\Downloads\yolo-windows-master (vs2013, Cuda 6.5, Git AlexeyAB)\yolo-windows-master\build\darknet\darknet\darknet.vcxproj : error : Unable to read the project file "darknet.vcxproj".

C:\Users(username)\Downloads\yolo-windows-master (vs2013, Cuda 6.5, Git AlexeyAB)\yolo-windows-master\build\darknet\darknet\darknet.vcxproj(55,5): The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Any help is much appreciated. Thank you for your time.

EDIT: I wanted to add that I've installed YOLO on Ubuntu, so I have a (very vague) idea of how it should work. Main problem with that installation is, I could get my GPU to function within Virtual Box, and because I need web cam real-time detection in my work, I'm trying to install YOLO on windows instead.

AlexeyAB commented 7 years ago

@olivesfang

  1. Try to update build/darknet/darknet/darknet.vcxproj from last commit.
  2. Try to delete all temporary files if it exist: .vcxproj.user .vcxproj.filters .vcproj...user .suo
  3. Open in MSVS 2013: darknet.vcxproj then, right click on project -> Build dependecies -> Build Customizations -> set check on CUDA 6.5 or 7.0 - for example as here: http://devblogs.nvidia.com/parallelforall/wp-content/uploads/2015/01/VS2013-R-5.jpg
olivesfang commented 7 years ago

Thank you for your reply, I appreciate it a lot. However, after cloning the new commission, I still encounter the same problem.

Also, here's the screenshot from step 3, when I open darknet.vcxproj in MSVS 2013. image

C:\Users(username)\Downloads\yolo-windows-master (vs2013, Cuda 6.5, Git AlexeyAB)\build\darknet\darknet\darknet.vcxproj : error : Unable to read the project file "darknet.vcxproj". C:\Users(username)\Downloads\yolo-windows-master (vs2013, Cuda 6.5, Git AlexeyAB)\build\darknet\darknet\darknet.vcxproj(55,5): The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 7.5.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I noticed it's asking for CUDA 7.5 now, which I have installed, but it still won't load. I can't get to building dependencies either. image

I look forward to your reply, every bit of help is greatly appreciated. Thanks so much!

AlexeyAB commented 7 years ago

@olivesfang Can you post screenshot from: HELP -> About Microsoft Visual Studio? Is there Visual C++?

I just successfully opened darknet.sln in each of the:

olivesfang commented 7 years ago

Here's the screenshot. I appreciate the response.

image

AlexeyAB commented 7 years ago

@olivesfang You can to create your own darknet.sln & darknet.vcxproj

Then add to your created project:

C:\opencv_2.4.9\opencv\build\include;..\..\..\3rdparty\include;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir)

C:\opencv_2.4.9\opencv\build\x64\vc12\lib;$(CUDA_PATH)lib\$(PlatformName);%(AdditionalLibraryDirectories)

..\..\..\3rdparty\lib\x64\pthreadVC2.lib;cublas.lib;curand.lib;cudart.lib;%(AdditionalDependencies)

OPENCV;_CRT_SECURE_NO_WARNINGS;GPU;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)

pthreadVC2.dll, pthreadGC2.dll from yolo-windows\3rdparty\dll\x64

cusolver64_75.dll, curand64_75.dll, cudart64_75.dll, cublas64_75.dll - 75 for CUDA 7.5 or your version, from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin

olivesfang commented 7 years ago

Thank you for your reply ... but there are some steps that I do not understand.

compile to .exe (X64 & Release)

  • You mean to build the project right? I don't understand if there are additional steps to make it "X64 & Release", can you direct me to a guide?

pthreadVC2.dll, pthreadGC2.dll from yolo-windows\3rdparty\dll\x64

  • But pthreadGC2.dll isn't in the specified folder?

These are the output errors: image image

I hope you are willing to continue to help me. Thank you so much for taking your time to teach me.

AlexeyAB commented 7 years ago

@olivesfang

What do you mean by $(CUDA_PATH)lib\$(PlatformName);? I ended up just adding that to my directories.

You should put exactly this line, not changing it. $(CUDA_PATH)lib\$(PlatformName);

compile to .exe (X64 & Release) You mean to build the project right? I don't understand if there are additional steps to make it "X64 & Release", can you direct me to a guide?

Yes, simply compile the project

pthreadVC2.dll, pthreadGC2.dll from yolo-windows\3rdparty\dll\x64 But pthreadGC2.dll isn't in the specified folder?

There are: pthreadGC2.dll, pthreadVC2.dll https://github.com/AlexeyAB/yolo-windows/tree/master/3rdparty/dll/x64

These are the output errors:

You should - I fixed it in my previous answer:

  1. first thing, at the beginning: right click on project -> Build dependecies -> Build Customizations -> set check on CUDA 7.5 or what version you have - for example as here: http://devblogs.nvidia.com/parallelforall/wp-content/uploads/2015/01/VS2013-R-5.jpg
  2. and only after 1-st step done, then: add to project all .c & .cu files from yolo-windows\src

And try to right click on any .cu-file -> properties, and you should see that there is CUDA C/C ++ compiler, not C/C++ compiler

olivesfang commented 7 years ago

Thanks for the help, but I still encountered the exact error when following the new instructions.

image

image

image

Is it possible to watch you look into the project via Team Viewer? Thank you so much for the help so far.

AlexeyAB commented 7 years ago

@olivesfang Unfortunately I can not give remote access, even readonly.

(right click) on any .cu-file -> properties

cudacpp

cudart

Can you provide each screenshot for each of steps?

olivesfang commented 7 years ago

You must make sure that for each .cu-file selected compiler CUDA C/C++ instead of C/C++ image

And you must make sure that cudart.lib added: image

Additional Include Directories image

Additional Library Directories image

Additional dependecies image

File path on my computer for OpenCV & yolo-windows for reference: image image image

Thanks for the help again. I've also checked each .cu-file and it does say the item type is CUDA C/C++, although it'd take a while to screenshot all of them (I will upload them shortly.)

By Team Viewer, I meant if you would be so kind to access my computer and see if there is a problem. Thanks for the prompt help!

AlexeyAB commented 7 years ago

@olivesfang

One last thing :)

Insert:

OPENCV
_CRT_SECURE_NO_WARNINGS
GPU
WIN32
NDEBUG
_CONSOLE
_LIB
olivesfang commented 7 years ago

Thanks! That allowed the project to start it's build. Unfortunately, it stopped shortly...

These are the error outputs: image

AlexeyAB commented 7 years ago

@olivesfang I fix some files in 2 last commits. Try to download new versions of 3 files from github:

olivesfang commented 7 years ago

Thanks again. After updating these files, this is the output error: image

I have checked the .cu and they are the correct item type.

AlexeyAB commented 7 years ago

@olivesfang

In these files: src/maxpool_layer_kernels.cu & src/softmax_layer_kernels.cu, after all #include's you can use:

#ifndef INFINITY
#include <limits>
const float INFINITY = std::numeric_limits<float>::infinity();
#endif

For example in src/softmax_layer_kernels.cu:

#include "cuda_runtime.h"
#include "curand.h"
#include "cublas_v2.h"
#include "math.h"

extern "C" {
#include "maxpool_layer.h"
#include "cuda.h"
}

#ifndef INFINITY
#include <limits>
const float INFINITY = std::numeric_limits<float>::infinity();
#endif

Or try to use this darknet2.vcxproj

I just now did everything on his instructions on MSVS 2013 & CUDA 7.5 - and it works for x64 (Release & Debug), but not for Win32 (Release & Debug).

olivesfang commented 7 years ago

Holy cow, I was able to compile darknet2.vcxproj successfully. Although ... the .exe file crashes upon execution and gives me the following errors regarding these files are missing and need to be re-installed:

If you have some time, please look into this. Thank you so much!

EDIT: I have the pthreadVC2.dll file at yolo-windows-master\yolo-windows-master\3rdparty\dll\x64 I see the opencv related .dll files are here C:\opencv_2.4.9\opencv\build\x64\vc12\bin

EDIT2: I was able to fix it easily by dragging the correct files to the root. Never mind! Currently having problems with execution, where the title + box won't appear (so it's not detecting at all ...)

olivesfang commented 7 years ago

Okay, so my executable doesn't seem to be detecting objects correctly. Real time webcam loaded, but wasn't detecting anything. Running the yolo test instead, I found prediction errors.

This is the input: image

And the prediction variables: image

The output: image

Thank you for looking into this!

olivesfang commented 7 years ago

Just reporting back that I was eventually able to compile with the original files in the repository with CUDA 7.5 and VS 2013. Thanks for the help!

AlexeyAB commented 7 years ago

@olivesfang Glad to hear. What was the problem and how it was solved? Now do you successfully detect the objects?

I changed all links to old weights-files in Readme.md (in the description of this fork) which successfully tested.