浏览 1395
已结题

darknet.dll 在C#中调用出错 cuDNN Error cudnn_convolutional_setup()

我采用的时darknet V4版本,在使用CUDA10.2 CUDNN8.0.5 OPENCV4.5.3编译完毕darknet之后,做darknet.exe测试,可以检测到dog图片,采用调用摄像头检测也是可以,并且可以看到GPU已经被使用。但是在使用darknet.dll时,出现错误。加载网络到一定时就报错,具体错误代码如下:

151 route  147                                    ->   38 x  38 x 256 
 152 conv    512       3 x 3/ 2     38 x  38 x 256 ->   19 x  19 x 512 0.852 BF
 153 route  152 116                                ->   19 x  19 x1024 
 154 conv    512       1 x 1/ 1     19 x  19 x1024 ->   19 x  19 x 512 0.379 BF
 155 conv   1024       3 x 3/ 1     19 x  19 x 512 ->   19 x  19 x1024 3.407 BF
 156 conv    512       1 x 1/ 1     19 x  19 x1024 ->   19 x  19 x 512 0.379 BF
 157 conv   1024       3 x 3/ 1     19 x  19 x 512 ->   19 x  19 x1024 3.407 BF
 158 conv    512       1 x 1/ 1     19 x  19 x1024 ->   19 x  19 x 512 0.379 BF
 159 conv   1024       3 x 3/ 1     19 x  19 x 512 ->   19 x  19 x1024 3.407 BF
 160 conv    255       1 x 1/ 1     19 x  19 x1024 ->   19 x  19 x 255 0.189 BF
 161 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.05
Total BFLOPS 128.459 
avg_outputs = 1068395 
 Allocate additional workspace_size = 81.03 MB 
Loading weights from .\yolov4.weights... Used GPU 0 
net.optimized_memory = 0 
mini_batch = 1, batch = 16, time_steps = 1, train = 1 
Create CUDA-stream - 0 
 Create cudnn-handle 0 
nms_kind: greedynms (1), beta = 0.600000 
nms_kind: greedynms (1), beta = 0.600000 
nms_kind: greedynms (1), beta = 0.600000 
Done! Loaded 162 layers from weights-file 
Darknet error location: E:\TRY\darknet-master\src\dark_cuda.c, cudnn_check_error, line #205
cuDNN Error: CUDNN_STATUS_BAD_PARAM: Bad file descriptor
 seen 64, trained: 32032 K-images (500 Kilo-batches_64) 
 cuDNN status Error in: file: E:\TRY\darknet-master\src\convolutional_layer.c : cudnn_convolutional_setup() : line: 253 : build time: Aug 17 2021 - 20:41:18 
 cuDNN Error: CUDNN_STATUS_BAD_PARAM。

我调用darknet.dll采用的C# wrapper。其调用的代码为:

  [DllImport(YoloLibraryGpu, EntryPoint = "init")]
        internal static extern int InitializeYoloGpu(string configurationFilename, string weightsFilename, int gpuIndex);
        [DllImport(YoloLibraryGpu, EntryPoint = "detect_image")]
        internal static extern int DetectImageGpu(string filename, ref BboxContainer container);
        [DllImport(YoloLibraryGpu, EntryPoint = "detect_mat")]
        internal static extern int DetectImageGpu(IntPtr pArray, int nSize, ref BboxContainer container);
        [DllImport(YoloLibraryGpu, EntryPoint = "dispose")]
        internal static extern int DisposeYoloGpu();
        [DllImport(YoloLibraryGpu, EntryPoint = "get_device_count")]
        internal static extern int GetDeviceCount();
        [DllImport(YoloLibraryGpu, EntryPoint = "get_device_name")]
        internal static extern int GetDeviceName(int gpu, StringBuilder deviceName);
        //每次程序都在初始化darknet网络的时候报错,即在下面这一行代码:
     this._yoloWrapper = new YoloWrapper(config.ConfigFile, config.WeightsFile, config.NamesFile, gpuConfig);

后面又换到cuda11.0,cudnn换到8.2.0,问题还是照旧出现!!!!
请码友帮忙参谋一下,请收下我的膝盖!

0

  • 编辑 收藏 删除
  • 追加酬金 (90%的用户在追加酬金后获得了解决方案)

    当前问题酬金

    ¥ 300 (您已提供 ¥ 20, 还可追加 ¥

    支付方式

    余额支付

    余额: ¥ 499

    扫码支付

    提供问题酬金的用户不参与问题酬金结算和分配

    支付即为同意 《付费问题酬金结算规则》

    10 条回答 默认 最新

    查看更多回答(-1条) 报告相同问题?

    问题事件

    • 系统已结题 8月25日
    • 修改了问题 8月20日
    • 修改了问题 8月20日
    • 创建了问题 8月17日

    悬赏问题

    • ¥20 beeline客户端支持ipv6地址连接hive服务 香农解码的代码问题,无法输出解码结果 Python操作注册表 入门级别的一段VUE前端拍照像后端发送请求的代码,帮排错 anaconda打开spyder后一直闪退,不知道怎么办 解决迷宫问题中无法运行的问题 关于aspnetcore中使用mqttnet库的entire 关于#python#的问题,请各位专家解答!