環境:CUDA 8.0、CUDnn7.0.5、OPENCV3.3.0
平臺:Jetson TX2
1.首先從Github上下載源碼
git clone https://github.com/hjimce/darknet_mobilenet.git
2.打開Makefile文件
將GPU、CUDNN、OPENCV都置1
出現問題:
cudnnSetConvolution2dDescriptor error: too few arguments in function call
函數缺少參數
解決辦法:找到src中的depthwise_convolutional_layer.c文件,75行改爲cudnnSetConvolution2dDescriptor(l->convDesc, l->pad, l->pad, l->stride, l->stride, 1, 1, CUDNN_CROSS_CORRELATION,CUDNN_DATA_FLOAT);即在函數最後添加一個參數:CUDNN_DATA_FLOAT
同樣在src/convolutional_layer.c中的133行的最後也添加CUDNN_DATA_FLOAT參數。
然後
make clean
make -j8
依然出現問題,報錯
obj/classifier.o: In function `gun_classifier':
classifier.c:(.text+0x37dc): undefined reference to `timersub'
解決方法:找到examples文件中的classifier.c文件,添加#include <sys/time.h>頭文件
再次:
make clean
make -j8
成功!