How to compile on Windows (using CMake)This is the recommended approach to build Darknet on Windows if you have already installed Visual Studio 2015/2017/2019, CUDA >= 10.0, cuDNN >= 7.0, and OpenCV >= 2.4.
Open a Powershell terminal inside the cloned repository and launch:
.build.ps1
How to compile on Windows (using vcpkg)- Install or update Visual Studio to at least version 2017, making sure to have it fully patched (run again the installer if not sure to automatically update to latest version). If you need to install from scratch, download VS from here: Visual Studio Community
- Install CUDA
- Install vcpkg and try to install a test library to make sure everything is working, for example vcpkg install opengl
- Open Powershell and type these commands:
PS >cd vcpkgPS Codevcpkg>.vcpkg install darknet[full]:x64-windows #replace with darknet[opencv-base,weights]:x64-windows for a quicker install; use --head if you want to build latest commit on master branch and not latest release
- You will find darknet inside the vcpkginstalled\x64-windowstoolsdarknet folder, together with all the necessary weight and cfg files
- If you have CUDA 10.0, cuDNN 7.4 and OpenCV 3.x (with paths: C:opencv_3.0opencvbuildinclude & C:opencv_3.0opencvbuild\x64vc14lib), then open builddarknetdarknet.sln, set x64 and Release https://hsto.org/webt/uh/fk/-e/uhfk-eb0q-hwd9hsxhrikbokd6u.jpeg and do the: Build -> Build darknet. Also add Windows system variable CUDNN with path to CUDNN: https://user-images.githubusercontent.com/4096485/53249764-019ef880-36ca-11e9-8ffe-d9cf47e7e462.jpg1.1. Find files opencv_world320.dll and opencv_ffmpeg320_64.dll (or opencv_world340.dll and opencv_ffmpeg340_64.dll) in C:opencv_3.0opencvbuild\x64vc14bin and put it near with darknet.exe1.2 Check that there are bin and include folders in the C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.0 if aren't, then copy them to this folder from the path where is CUDA installed1.3. To install CUDNN (speedup neural network), do the following:download and install cuDNN v7.4.1 for CUDA 10.0: https://developer.nvidia.com/rdp/cudnn-archiveadd Windows system variable CUDNN with path to CUDNN: https://user-images.githubusercontent.com/4096485/53249764-019ef880-36ca-11e9-8ffe-d9cf47e7e462.jpgcopy file cudnn64_7.dll to the folder builddarknet\x64 near with darknet.exe1.4. If you want to build without CUDNN then: open darknet.sln -> (right click on project) -> properties -> C/C++ -> Preprocessor -> Preprocessor Definitions, and remove this: CUDNN;
- If you have other version of CUDA (not 10.0) then open builddarknetdarknet.vcxproj by using Notepad, find 2 places with "CUDA 10.0" and change it to your CUDA-version. Then open darknet.sln -> (right click on project) -> properties -> CUDA C/C++ -> Device and remove there ;compute_75,sm_75. Then do step 1
- If you don't have GPU, but have OpenCV 3.0 (with paths: C:opencv_3.0opencvbuildinclude & C:opencv_3.0opencvbuild\x64vc14lib), then open builddarknetdarknet_no_gpu.sln, set x64 and Release, and do the: Build -> Build darknet_no_gpu
- If you have OpenCV 2.4.13 instead of 3.0 then you should change paths after darknet.sln is opened4.1 (right click on project) -> properties -> C/C++ -> General -> Additional Include Directories: C:opencv_2.4.13opencvbuildinclude4.2 (right click on project) -> properties -> Linker -> General -> Additional Library Directories: C:opencv_2.4.13opencvbuild\x64vc14lib
- If you have GPU with Tensor Cores (nVidia Titan V / Tesla V100 / DGX-2 and later) speedup Detection 3x, Training 2x: darknet.sln -> (right click on project) -> properties -> C/C++ -> Preprocessor -> Preprocessor Definitions, and add here: CUDNN_HALF;Note: CUDA must be installed only after Visual Studio has been installed.
推荐阅读
- windows.old可以删除吗?
- 一个可放大图像的开源的浏览器扩展
- 新windows勒索软件变种,通过USB驱动横向传播
- 让Mac电脑读取NTFS硬盘的免费开源的软件
- 9个优秀的 VUE 开源项目
- Win 10系统盘突然满了,不下载第三方软件,应该怎么清理?
- CentOS7上安装与配置开源堡垒机Teleport
- 全球知名25种开源情报库
- Win7家庭版如何给文件夹设置密码?Win7文件夹加密方法
- Ubuntu安装及配置