AlexeyAB / darknet

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

GPU is't used on Windows! #6003

Open huizhang2017 opened 4 years ago

huizhang2017 commented 4 years ago

HI..., Though many people has submitted the issue about the " GPU is'n used" , I still can not figure out on Windows. By the way, I have revised the Makefile, and set GPU=1,CUDNN=1,CUDNN_HALF=1,OPENCV=1 .

The output information is as follows (please just focus on the bold to save your time.):

****Information one START ** (base) PS D:\skull_3000\darknet-master> darknet.exe detector train data/obj.data ./cfg/yolo-obj.cfg yolov4.conv.137 GPU isn't used Used AVX Used FMA & AVX2 OpenCV isn't used - data augmentation will be slow yolo-obj mini_batch = 4, batch = 64, time_steps = 1, train = 1 layer filters size/strd(dil) input output 0 conv 32 3 x 3/ 1 608 x 608 x 3 -> 608 x 608 x 32 0.639 BF 1 conv 64 3 x 3/ 2 608 x 608 x 32 -> 304 x 304 x 64 3.407 BF 2 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF 3 route 1 -> 304 x 304 x 64 ...... *information one END *****

***Information two START **** (base) PS D:\skull_3000\darknet-master> .\build.ps1 Skipping vcpkg-enabled builds because the VCPKG_ROOT environment variable is not defined or you requested to avoid VCPKG, using self-distributed libs

Setting up environment to use CMake generator: Visual Studio 16 2019

目录: D:\skull_3000\darknet-master

Mode LastWriteTime Length Name


d----- 2020/6/18 10:10 build_win_release_novcpkg -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763. -- PThreads_windows_DLL_DIR: D:/skull_3000/darknet-master/3rdparty/pthreads/include/../bin -- OpenCV ARCH: x64 -- OpenCV RUNTIME: -- OpenCV STATIC: OFF CMake Warning at C:/Users/hzhang/Anaconda3/Library/OpenCVConfig.cmake:138 (message): Found OpenCV Windows Pack but it has no binaries compatible with your configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV library. Call Stack (most recent call first): CMakeLists.txt:103 (find_package)

CMake Warning at CMakeLists.txt:103 (find_package): Found package configuration file:

C:/Users/hzhang/Anaconda3/Library/OpenCVConfig.cmake

but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.

-- Found OpenMP_C: -openmp -- Found OpenMP_CXX: -openmp -- Found OpenMP: TRUE -- ZED SDK not enabled, since it requires CUDA -- Configuring done -- Generating done -- Build files have been written to: D:/skull_3000/darknet-master/build_win_release_novcpkg 用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.6.0+5ff7b0c9e 版权所有(C) Microsoft Corporation。保留所有权利。

Checking Build System CMake does not need to re-run because D:/skull_3000/darknet-master/build_win_release_novcpkg/CMakeFiles/generate.stamp is up-to-date. Building Custom Rule D:/skull_3000/darknet-master/CMakeLists.txt CMake does not need to re-run because D:/skull_3000/darknet-master/build_win_release_novcpkg/CMakeFiles/generate.stamp is up-to-date. Using triplet "x64-windows" from "C:\Users\hzhang\vcpkg-master\installed\x64-windows\" yolo_v2_class.cpp http_stream.cpp image_opencv.cpp 正在生成代码... activation_layer.c activations.c art.c avgpool_layer.c batchnorm_layer.c blas.c box.c captcha.c cifar.c classifier.c coco.c col2im.c compare.c connected_layer.c conv_lstm_layer.c convolutional_layer.c cost_layer.c cpu_gemm.c crnn_layer.c crop_layer.c 正在生成代码... 正在编译... dark_cuda.c data.c deconvolutional_layer.c demo.c detection_layer.c detector.c dice.c dropout_layer.c gaussian_yolo_layer.c gemm.c getopt.c gettimeofday.c go.c gru_layer.c im2col.c image.c layer.c list.c local_layer.c lstm_layer.c 正在生成代码... 正在编译... matrix.c maxpool_layer.c network.c nightmare.c normalization_layer.c option_list.c parser.c region_layer.c reorg_layer.c reorg_old_layer.c rnn.c rnn_layer.c rnn_vid.c route_layer.c sam_layer.c scale_channels_layer.c shortcut_layer.c softmax_layer.c super.c swag.c 正在生成代码... 正在编译... tag.c tree.c upsample_layer.c utils.c voxel.c writing.c yolo.c yolo_layer.c 正在生成代码... 正在创建库 D:/skull_3000/darknet-master/build_win_release_novcpkg/Release/dark.lib 和对象 D:/skull_3000/darknet-master/build_win_release_novcpkg/Release/dark.exp dark.vcxproj -> D:\skull_3000\darknet-master\build_win_release_novcpkg\Release\dark.dll Building Custom Rule D:/skull_3000/darknet-master/CMakeLists.txt CMake does not need to re-run because D:/skull_3000/darknet-master/build_win_release_novcpkg/CMakeFiles/generate.stamp is up-to-date. Using triplet "x64-windows" from "C:\Users\hzhang\vcpkg-master\installed\x64-windows\" darknet.c activation_layer.c activations.c art.c avgpool_layer.c batchnorm_layer.c blas.c box.c captcha.c cifar.c classifier.c coco.c col2im.c compare.c connected_layer.c conv_lstm_layer.c convolutional_layer.c cost_layer.c cpu_gemm.c crnn_layer.c 正在生成代码... 正在编译... crop_layer.c dark_cuda.c data.c deconvolutional_layer.c demo.c detection_layer.c detector.c dice.c dropout_layer.c gaussian_yolo_layer.c gemm.c getopt.c gettimeofday.c go.c gru_layer.c im2col.c image.c layer.c list.c local_layer.c 正在生成代码... 正在编译... lstm_layer.c matrix.c maxpool_layer.c network.c nightmare.c normalization_layer.c option_list.c parser.c region_layer.c reorg_layer.c reorg_old_layer.c rnn.c rnn_layer.c rnn_vid.c route_layer.c sam_layer.c scale_channels_layer.c shortcut_layer.c softmax_layer.c super.c 正在生成代码... 正在编译... swag.c tag.c tree.c upsample_layer.c utils.c voxel.c writing.c yolo.c yolo_layer.c 正在生成代码... http_stream.cpp image_opencv.cpp 正在生成代码... darknet.vcxproj -> D:\skull_3000\darknet-master\build_win_release_novcpkg\Release\darknet.exe Building Custom Rule D:/skull_3000/darknet-master/CMakeLists.txt CMake does not need to re-run because D:/skull_3000/darknet-master/build_win_release_novcpkg/CMakeFiles/generate.stamp is up-to-date. Using triplet "x64-windows" from "C:\Users\hzhang\vcpkg-master\installed\x64-windows\" yolo_console_dll.cpp uselib.vcxproj -> D:\skull_3000\darknet-master\build_win_release_novcpkg\Release\uselib.exe Building Custom Rule D:/skull_3000/darknet-master/CMakeLists.txt CMake does not need to re-run because D:/skull_3000/darknet-master/build_win_release_novcpkg/CMakeFiles/generate.stamp is up-to-date. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5):

Note: here are the warnings: warning MSB8065: 项“D:\skull_3000\darknet-master\buildwin release_novcpkg\CMakeFiles\3b9328b01258d56c1f78b90f6e88111d\INSTALL_force.rule”的自定义生成成功,但尚未创建指定的输出“d:\skull_3000\darknet-master\build_win_release_novcpkg\cmakefiles\install_force”。这可 能会导致增量生成无法正常工作。 [D:\skull_3000\darknet-master\build_win_releasenovcpkg\install.vcxproj]** -- Install configuration: "Release

-- Up-to-date: D:/skull_3000/darknet-master/dark.lib -- Installing: D:/skull_3000/darknet-master/dark.dll -- Up-to-date: D:/skull_3000/darknet-master/include/darknet/darknet.h -- Up-to-date: D:/skull_3000/darknet-master/include/darknet/yolo_v2_class.hpp -- Installing: D:/skull_3000/darknet-master/uselib.exe -- Installing: D:/skull_3000/darknet-master/darknet.exe -- Up-to-date: D:/skull_3000/darknet-master/share/darknet/DarknetTargets.cmake -- Installing: D:/skull_3000/darknet-master/share/darknet/DarknetTargets-release.cmake -- Up-to-date: D:/skull_3000/darknet-master/share/darknet/DarknetConfig.cmake -- Installing: D:/skull_3000/darknet-master/share/darknet/DarknetConfigVersion.cmake *information one END *****

So, could anyone tell me why the GPU isn't used on windows? Is it caused by the warning during the building (.\build.ps1) ? How to fix it?

belian001 commented 4 years ago

I am the same, how can I solve it?

belian001 commented 4 years ago

I compiled with win10 CMAKE, showing that the GPU is not used

KyloEntro commented 4 years ago

Have you install CUDA toolkit and cudnn ? Do windows environment variables contain path to cuda toolkit ?

dsbyprateekg commented 4 years ago

@belian001 @huizhang2017 follow this post- http://dsbyprateekg.blogspot.com/2020/05/how-to-install-and-compile-yolo-v4-with.html

huizhang2017 commented 4 years ago

Have you install CUDA toolkit and cudnn ? Do windows environment variables contain path to cuda toolkit ?

I am pretty sure I have add the cuda toolkit path to the windows environment variables.

not-matthias commented 4 years ago

I also had some build cache issues. Deleting the folder and cloning the repository again fixed it.