The environment is
Ubuntu 16.04
CUDA 9.1
Opencv3.3.0
I tried to use YOLOv3 using GPU, but I got an error in make.
What I did below
git clone https://github.com/pjreddie/darknet
cd darknet
Change to vim Makefile#GPU=1, OPENCV=1
make
Error Contents
gcc-Iinclude/-Isrc/-DOPENCV`pkg-config --cflags opencv`-DGPU-I/usr/local/cuda-9.1/include/-Wall-Wno-unused-result-Wno-unknown-pragmas-Watal-errors-fstICP-DV/OV/DVpulm.
File included from /usr/local/include/opencv2/core/types_c.h:59:0 ,
from /usr/local/include/opencv2/core/core_c.h:48,
from/usr/local/include/opencv2/highgui/highgui_c.h:45,
from include/darknet.h:25,
from./src/utils.h —5,
from./src/gemm.c:2:
/usr/local/include/opencv2/core/cvdef.h:485:1:error:unknown type name 'namespace'
namespace cv {
compilation terminated due to-Wfatal-errors.
Makefile:85: recipe for target'obj/gemm.o'failed
make:***[obj/gemm.o]Error1
In conclusion, I was able to run darknet make
in Opencv 3.4.0.
I don't know which one really worked because I've tried many things, but I'll write down what I did I do.
In the darknet Makefile, first set OPENCV=1
and set the others to 0 to make.
After make
can be executed, make clean
.
Finally, in the darknet Makefile, OPENCV=1, GPU=1
and make
to run it.
OpenCV related error.The OpenCV namespace itself has not been found, so I think OpenCV is probably not well recognized.Review the configuration settings around OpenCV.
Also, the version is different from this question, but OpenCV 3.4.1 has a bug and cannot be built.Wait for it to fix or downgrade (Reference).The same version of OpenCV 3.3.0, which is the same as this question, has been successfully built in this environment.
© 2024 OneMinuteCode. All rights reserved.