AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.64k stars 7.95k forks source link

VS2019 error MSB3721 #6442

Open CowInSiberia opened 4 years ago

CowInSiberia commented 4 years ago

1 Hello. When I tried to compile yolov4 on windows in a legacy way, I encoutered this problem shown in the sceenshot above. My environment is CUDA10.0+CUDNN7.4.2+OpenCV3.4 my GPU is RTX2060. I also screenshot my visual studio configuration down below. 2 3 4 Besides, since my GPU is 2060 so I didnt change CUDA/Device/Code Generation, the value is sill "compute30,sm30;compute 75,sm75". I tried deleted the "75value" both in VS and darknet.vcxproj but it didnt work. Hope to get answer soon, thanks a lot!

dayfixer commented 4 years ago

I have the same issue and I spent a day (google ...)and almost still didn't solve it...

but ...

I realized that I have installed 3 versions of CUDA(10.0, 10.1, 10.2)...maybe this is the reason, so I use uninstall tools to uninstall all the CUDA packages...

a clean windows!

then restart PC, and reinstall the cuda10.1 with cudnn7.6,

run build.ps1

this works!

CowInSiberia commented 4 years ago

@dayfixer Congratulations! However, my laptop has only one version of CUDA(10.0) and my classmates also encountered the same problem. I tried build.ps1 at first but I can only use command line to detect pictures, when I run darknet.exe detector...test.mp4 I got the "GPU isnt used. Demo needs OpenCV for webcam images" in cmd, so I tried to compile it in a legacy way. Sadly I didnt make it in neither ways.

dayfixer commented 4 years ago

add Environment variable OPENCV_DIR, value like D:\opencv4.4\build

and the lib path of opencv must be added in PATH, value like %OPENCV_DIR%\x64\vc15\bin,

when u run build.ps1, you can find the cmake output ,such as

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         2020/8/9     12:49                build_win_release_novcpkg
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.26.28806.0
-- The CXX compiler identification is MSVC 19.26.28806.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found PThreads_windows: E:/Projects/darknet-master/3rdparty/pthreads/lib/pthreadVC2.lib
-- PThreads_windows_DLL_DIR: E:/Projects/darknet-master/3rdparty/pthreads/include/../bin
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: vc15
-- OpenCV STATIC: OFF
-- Found OpenCV: D:/opencv4.4/build (found version "4.4.0")
-- Found OpenCV 4.4.0 in D:/opencv4.4/build/x64/vc15/lib
-- You might need to add D:\opencv4.4\build\x64\vc15\bin to your PATH to be able to run your applications.
-- Found Stb: E:/Projects/darknet-master/3rdparty/stb/include
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- ZED SDK not enabled, since it requires CUDA
-- Configuring done
-- Generating done
-- Build files have been written to: E:/Projects/darknet-master/build_win_release_novcpkg
用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.6.0+5ff7b0c9e
版权所有(C) Microsoft Corporation。保留所有权利。

notice that -- Looking for a CUDA compiler -- Looking for a CUDA compiler - NOTFOUND which is not use the GPU and the opencv path, If you don't set the environment variable of opencv, cmake can't find it