我正在尝试使用GPU = 1,OPENCV = 1,DEBUG = 1来编译YOLO。与DEBUG = 0相同的组合已成功编译,但是当我使用DEBUG = 1时,导致编译失败。
>>make
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/gemm.c -o obj/gemm.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/utils.c -o obj/utils.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/cuda.c -o obj/cuda.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/convolutional_layer.c -o obj/convolutional_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/list.c -o obj/list.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/image.c -o obj/image.o
./src/image.c: In function ‘load_image_cv’:
./src/image.c:488:16: warning: implicit declaration of function ‘cvLoadImage’ [-Wimplicit-function-declaration]
if( (src = cvLoadImage(filename, flag)) == 0 )
^
./src/image.c:488:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
if( (src = cvLoadImage(filename, flag)) == 0 )
^
./src/image.c: In function ‘save_image_jpg’:
./src/image.c:530:5: warning: implicit declaration of function ‘cvSaveImage’ [-Wimplicit-function-declaration]
cvSaveImage(buff, disp,0);
^
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/activations.c -o obj/activations.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/im2col.c -o obj/im2col.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/col2im.c -o obj/col2im.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/blas.c -o obj/blas.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/crop_layer.c -o obj/crop_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/dropout_layer.c -o obj/dropout_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/maxpool_layer.c -o obj/maxpool_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/softmax_layer.c -o obj/softmax_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/data.c -o obj/data.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/matrix.c -o obj/matrix.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/network.c -o obj/network.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/connected_layer.c -o obj/connected_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/cost_layer.c -o obj/cost_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/parser.c -o obj/parser.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/option_list.c -o obj/option_list.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/darknet.c -o obj/darknet.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/detection_layer.c -o obj/detection_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/captcha.c -o obj/captcha.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/route_layer.c -o obj/route_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/writing.c -o obj/writing.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/box.c -o obj/box.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/nightmare.c -o obj/nightmare.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/normalization_layer.c -o obj/normalization_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/avgpool_layer.c -o obj/avgpool_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/coco.c -o obj/coco.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/dice.c -o obj/dice.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/yolo.c -o obj/yolo.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/detector.c -o obj/detector.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/layer.c -o obj/layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/compare.c -o obj/compare.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/classifier.c -o obj/classifier.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/local_layer.c -o obj/local_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/swag.c -o obj/swag.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/shortcut_layer.c -o obj/shortcut_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/activation_layer.c -o obj/activation_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/rnn_layer.c -o obj/rnn_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/gru_layer.c -o obj/gru_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/rnn.c -o obj/rnn.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/rnn_vid.c -o obj/rnn_vid.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/crnn_layer.c -o obj/crnn_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/demo.c -o obj/demo.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/tag.c -o obj/tag.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/cifar.c -o obj/cifar.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/go.c -o obj/go.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/batchnorm_layer.c -o obj/batchnorm_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/art.c -o obj/art.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/region_layer.c -o obj/region_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/reorg_layer.c -o obj/reorg_layer.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/super.c -o obj/super.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/voxel.c -o obj/voxel.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/tree.c -o obj/tree.o
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/activation_kernels.cu -o obj/activation_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/im2col_kernels.cu -o obj/im2col_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/col2im_kernels.cu -o obj/col2im_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/blas_kernels.cu -o obj/blas_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/crop_layer_kernels.cu -o obj/crop_layer_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/dropout_layer_kernels.cu -o obj/dropout_layer_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/maxpool_layer_kernels.cu -o obj/maxpool_layer_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/network_kernels.cu -o obj/network_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc -gencode arch=compute_20,code=[sm_20,sm_21] -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] -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU" -c ./src/avgpool_layer_kernels.cu -o obj/avgpool_layer_kernels.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU obj/gemm.o obj/utils.o obj/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/super.o obj/voxel.o obj/tree.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 -pthread `pkg-config --libs opencv` -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lstdc++
obj/image.o: In function `cvPointFrom32f':
/usr/local/include/opencv2/core/types_c.h:929: undefined reference to `cvRound'
/usr/local/include/opencv2/core/types_c.h:930: undefined reference to `cvRound'
obj/image.o: In function `cvReadInt':
/usr/local/include/opencv2/core/core_c.h:2350: undefined reference to `cvRound'
obj/image.o: In function `cvEllipseBox':
/usr/local/include/opencv2/imgproc/imgproc_c.h:1041: undefined reference to `cvRound'
/usr/local/include/opencv2/imgproc/imgproc_c.h:1042: undefined reference to `cvRound'
obj/darknet.o:/usr/local/include/opencv2/core/types_c.h:929: more undefined references to `cvRound' follow
collect2: error: ld returned 1 exit status
Makefile:63: recipe for target 'darknet' failed
make: *** [darknet] Error 1
不知何故,我强烈认为它存在opencv的问题或与gdb的兼容性。
有关如何解决此问题的任何想法?
答案 0 :(得分:10)
我向opencv报告了关于这个bug的问题并收到了一个奇怪的回复!!这是与此相关的线程: opencv3 bug related to cvRound
他们提到在使用gcc编译时,OpenCV对C的支持并不能正常工作。
因此,我暂时修改了opencv代码以使调试器工作:
我所做的改变是:
将 cvRound 替换为 ceil ,将math.h包含在文件opencv2/core/types_c.h
opencv2/core/core_c.h
和opencv2/imgproc/imgproc_c.h
/usr/local/include
中权限
然后使用DEBUG = 1
成功编译了YOLO代码或者 - 如果您不想更改openCV代码 - 您可以在其中一个yolo文件中执行类似的解决方法。例如:在detector.c的开头添加:
#include "math.h"
int cvRound(double value) {return(ceil(value));}
答案 1 :(得分:5)
关于这个问题,answer帮助解决了这个问题。
在原版yolo / darknet中,您可以看到为了调试Joseph Redmon传递不要将标记优化为gcc here:
ifeq ($(DEBUG), 1)
OPTS=-O0 -g
endif
但是,要解决该问题,您可以使用do not conflict with debugging的优化,在Makefile中替换为:
ifeq ($(DEBUG), 1)
OPTS=-Og -g
endif
我认为问题与优化选项完全相关。最初作者没有遇到这个问题,因为他使用的Intel Core i7-5820K具有一些特定的属性,并且不会出现冲突。
答案 2 :(得分:1)
不知何故,我强烈感觉到opencv的问题
正确:开发人员仅使用DEBUG=0
进行编译并且从不尝试DEBUG=1
(反之亦然)并不罕见。无论哪个设置都是默认测试,非默认设置只有在用户报告问题时才会修复(您应该这样做)。
或与gdb的兼容性。
这与GDB没有没有。