完全按照官网步骤,clone之后修改Makefile,增加opencv、cuda、cudnn支持,然后进行make,结果出现:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/usr/bin/ld: warning: libzstd.so.1.3.7, needed by //home/mcj/anaconda3/lib/libtiff.so.5, not found (try using -rpath or -rpath-link) //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_freeCStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_maxCLevel’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_getErrorName’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_createDStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_freeDStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_compressStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_decompressStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_initCStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_createCStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_isError’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_endStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_initDStream’未定义的引用 collect2: error: ld returned 1 exit status Makefile:77: recipe for target 'darknet' failed make: *** [darknet] Error 1 |
解决方法:
打开profile文件:
1 |
sudo vim /etc/profile |
在文件末尾添加(注意路径):
1 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/mcj/anaconda3/lib |
然后激活一下:
1 |
source /etc/profile |
修改后编译效果如下:
1 2 3 4 |
gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/darknet.c -o obj/darknet.o gcc -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -shared obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.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/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/iseg_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/deconvolutional_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/avgpool_layer_kernels.o -o libdarknet.so -lm -pthread `pkg-config --libs opencv` -lstdc++ -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lcudnn -lstdc++ ar rcs libdarknet.a obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.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/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/iseg_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/deconvolutional_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/avgpool_layer_kernels.o gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN obj/captcha.o obj/lsd.o obj/super.o obj/art.o obj/tag.o obj/cifar.o obj/go.o obj/rnn.o obj/segmenter.o obj/regressor.o obj/classifier.o obj/coco.o obj/yolo.o obj/detector.o obj/nightmare.o obj/instance-segmenter.o obj/darknet.o libdarknet.a -o darknet -lm -pthread `pkg-config --libs opencv` -lstdc++ -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lcudnn -lstdc++ libdarknet.a |
本文最后更新于2021年9月8日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
看看
看看大神
看看
好
让我康康
康康
看看
看看
出现问题,来看看大神怎么解决
想看看
看看
大爷的
@felix 怎么了?垃圾?
看看
..想看看。。。
好好好!
看看
评论必须包含汉字
阿三大赛的
开讲啦的
牛牛
腻害666666
牛牛
看一眼
n牛逼
牛逼
顶
看一下
顶
挺好的
看一下