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

install yolov4 error when opencv=1 #5656

Open yustaub opened 4 years ago

yustaub commented 4 years ago

./src/network_kernels.cu: In function ‘float train_network_datum_gpu(network, float*, float*)’: ./src/network_kernels.cu:359:7: warning: variable ‘l’ set but not used [-Wunused-but-set-variable] layer l = net.layers[net.n - 1]; ^ ./src/network_kernels.cu:368:7: warning: variable ‘im’ set but not used [-Wunused-but-set-variable] image im; ^ nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DOPENCVpkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv-DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -c ./src/avgpool_layer_kernels.cu -o obj/avgpool_layer_kernels.o g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCVpkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv-DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include obj/image_opencv.o obj/http_stream.o obj/gemm.o obj/utils.o obj/dark_cuda.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/darknet.o obj/detection_layer.o obj/captcha.o obj/route_layer.o obj/writing.o obj/box.o obj/nightmare.o obj/normalization_layer.o obj/avgpool_layer.o obj/coco.o obj/dice.o obj/yolo.o obj/detector.o obj/layer.o obj/compare.o obj/classifier.o obj/local_layer.o obj/swag.o obj/shortcut_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/rnn.o obj/rnn_vid.o obj/crnn_layer.o obj/demo.o obj/tag.o obj/cifar.o obj/go.o obj/batchnorm_layer.o obj/art.o obj/region_layer.o obj/reorg_layer.o obj/reorg_old_layer.o obj/super.o obj/voxel.o obj/tree.o obj/yolo_layer.o obj/gaussian_yolo_layer.o obj/upsample_layer.o obj/lstm_layer.o obj/conv_lstm_layer.o obj/scale_channels_layer.o obj/sam_layer.o obj/convolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/network_kernels.o obj/avgpool_layer_kernels.o -o darknet -lm -pthreadpkg-config --libs opencv4 2> /dev/null || pkg-config --libs opencv-L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -L/usr/local/cudnn/lib64 -lcudnn -lstdc++ g++: error: /usr/lib/x86_64-linux-gnu/libopencv_core.so: No such file or directory g++: error: /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so: No such file or directory Makefile:159: recipe for target 'darknet' failed make: *** [darknet] Error 1 when I set OPENCV=1 this error happened, when I set OPENCV=0 it can succeed, but I want to train coco dataset ,it requires opencv, how can I solve this problem? very appreciate for your reply

WongKinYiu commented 4 years ago

sudo apt install libopencv-dev

yustaub commented 4 years ago

thk u , I will try it @WongKinYiu

niujindacidian commented 4 years ago

Have you solved it yet? @yustaub

yustaub commented 4 years ago

@niujindacidian I do not have the power of sudo , and I change to another machine and it works

niujindacidian commented 4 years ago

Ok, thank you!

WongKinYiu commented 4 years ago

if you do not have sudo, you can build opencv from source.

yustaub commented 4 years ago

sudo apt install libopencv-dev

hello, I run this command and still this error

yustaub commented 4 years ago

Have you solved it yet? have you solved it now? @niujindacidian

philipperemy commented 4 years ago

Remove compute_30 in the Makefile. It's old (Kepler arch). Or downgrade your CUDA to 10.2.