windows+cuda9.2+vs2015 compile darknet yolov4

The author's environment:

win7 (the same for 8,10)+GT765M+cuda9.2+cudnn7.2.1 (7.6.5 is also OK, does not affect)

Compilation steps:

1. Search for and install the graphics card driver corresponding to your computer on the NVIDIA official website: attach the link
Insert picture description here
2. Install cuda (10.0 version is recommended, so there is a file that does not need to be modified, hehe)
There are tutorials for cuda installation in many blogs, the author just No more narrative.
Note: There are several precautions for the installation of cuda and cudnn
(1. Do not check the driver when customizing the
cuda installation ; 2. The subsequent update patch of cuda can be installed directly after cuda is installed;
3. cudnn is directly decompressed, Go to each deepest folder in turn, copy the files inside to the folder with the same name of cuda [very important];
4. Create environment variables for cuda and cudnn [very important].)
Insert picture description here

3. Install OpenCV3.4.2 (other versions will also work)

Direct official website select the version to download on the line, simply double-click the default installation, add the environment variable: C: \ OpenCV \ Build \ the include;
C: \ OpenCV \ Build \ x64 \ vc14 \ lib;

4. Install vs2015 (not vs2017)

Note: You can install the community version and it’s free after login. Versions below cuda10.0 do not support vs2017, so be careful!

5. Compile darknet

(The cuda10.0 version ignores (1))
(1). Enter the darknet/build/darknet path, open darknet.vcxproj with notepad, find the two cuda10.0 locations in the figure below, and change to your own cuda version (author Change 10.0 to 9.2), the rest do not need to be changed.
Insert picture description here
Insert picture description here
Insert picture description here
(2) Open darknet.sln with vs2015
Insert picture description here
(3) Change the position of the icon to release, x64
Insert picture description here
(4) Open the project -> Properties
Insert picture description here
(5) The position in the circle below must be modified to vs2015 (v140)
Insert picture description here
(6) Enter C/C++ -> General -> Additional include directory, change the path of opencv_3.0 to your own opencv path.
Insert picture description here
Insert picture description here
This is the author's revised
Insert picture description here
(7) If the graphics card garbage is as garbage as the author, you must delete the two 75 items in CUDA C/C++ ->Device->Code Generation (75 means graphics card computing power). (The advanced graphics card ignores this step)
Insert picture description here
(8) Go to the linker->General->Additional library directory and change the path of opencv_3.0 to your own opencv path.
Insert picture description here
Insert picture description here
This is the author's revised: there is
Insert picture description here
no need to change the rest, click apply and confirm.

(9) At this point, the compilation preparation is complete, start the compilation:
click Generate -> Generate darknet to
Insert picture description here
compile successfully (ignore the warning, it will not affect the use of yolov4), and the darknet.exe file is generated in the x64 directory.
Insert picture description here
Insert picture description here

6. Test yolov4 with compiled darknet

Enter the x64 folder where darknet.exe was just generated, and enter the test command:

darknet.exe detector test data/coco.data cfg/yolov4.cfg backup/yolov4.weights data/dog.jpg

Insert picture description here
Insert picture description here
Finally, attach the download link of darknet_yolov4 source code and weight:
darknet_yolov4 source code: https://github.com/AlexeyAB/darknet
yolov4 weight: https://72k.us/file/26468910-439532813 Extract password: 446792

Guess you like

Origin blog.csdn.net/weixin_44414948/article/details/106080486