onnx2caffe icon indicating copy to clipboard operation
onnx2caffe copied to clipboard

cudnn_conv_layer.cpp:53] Check failed: status == CUDNN_STATUS_SUCCESS (4 vs. 0) CUDNN_STATUS_INTERNAL_ERROR

Open MiniBullLab opened this issue 6 years ago • 16 comments

MiniBullLab avatar Oct 12 '19 09:10 MiniBullLab

have the problem been solved? I hace the same problem.

kongchibin avatar Oct 31 '19 04:10 kongchibin

I have the same problem as well......

FunnyExplorer avatar Nov 21 '19 02:11 FunnyExplorer

I solve this issue when I turn my prototxt to in-place mode

kongchibin avatar Nov 21 '19 03:11 kongchibin

But it happened when I run the convertCaffe.py. (the process of generating the prototxt and caffemodel) How could I solve the issue?

FunnyExplorer avatar Nov 21 '19 03:11 FunnyExplorer

you can modify the function convertToCaffe in convertCaffe.py, this func can be seen as two parts, one for generating the prototxt, the other for generating the caffemode ,(https://github.com/MTlab/onnx2caffe/blob/46ae6b8b7838361e80cb441a4ca3d082be21bf44/convertCaffe.py#L73) you just comment the second part,then you can get the prototxt

kongchibin avatar Nov 21 '19 03:11 kongchibin

you divide the func convertToCaffe into two parts, one for prototxt , the other for caffemode, then you can modify the prototxt that is generated by the first part to in-place mode, then feed this in-place mode prototxt to the scecond part

kongchibin avatar Nov 21 '19 03:11 kongchibin

How do you turn the prototxt to in-place mode? Could you please show me an example?

FunnyExplorer avatar Nov 21 '19 03:11 FunnyExplorer

you can find lots of examples in internet

kongchibin avatar Nov 21 '19 03:11 kongchibin

Do you mean set the 'in_place' True in relu, bn and scale ?

FunnyExplorer avatar Nov 21 '19 03:11 FunnyExplorer

I added 'engine: CAFFE' to some of the convolution layers and the caffemodel is generated successfully. Thank you so much!

FunnyExplorer avatar Nov 21 '19 05:11 FunnyExplorer

@FunnyExplorer Hi, i met the same problem, where should i add the 'engine:CAFFE' to the convolutuion layers? plz help.

wanglaotou avatar Apr 01 '20 07:04 wanglaotou

图片 @kongchibin , i use your methods and it works, thankyou.

wanglaotou avatar Apr 01 '20 10:04 wanglaotou

I tried to disable the Cudnn when compile Caffe, and then I can convert the model without this problem.

WGYi avatar Apr 15 '20 05:04 WGYi

I tried to disable the Cudnn when compile Caffe, and then I can convert the model without this problem. Yes,you are right! Good!

ruabuliuqiu avatar Aug 03 '20 12:08 ruabuliuqiu

Disable the Cudnn when compile Caffe works for me ,too.

Eliza-and-black avatar Aug 04 '20 06:08 Eliza-and-black

Edit _operators.py to add engine: CAFFE for depth-wise conv in prototxt.

    if groups!=W.shape[0]:
        layer = myf("Convolution", node_name, [input_name], [output_name],
                    kernel_h = kernel_shape[0],kernel_w = kernel_shape[1],
                    stride_h=strides[0], stride_w = strides[1], group = groups,
                    pad_h = pads[0], pad_w = pads[1],
                    num_output=W.shape[0],  dilation = dilations[0], bias_term = bias_flag)
    else:
        # for dw conv
        layer = myf("Convolution", node_name, [input_name], [output_name],
                    kernel_h=kernel_shape[0], kernel_w=kernel_shape[1],
                    stride_h=strides[0], stride_w=strides[1], group=groups,
                    pad_h=pads[0], pad_w=pads[1],
                    num_output=W.shape[0], dilation=dilations[0], bias_term=bias_flag, engine=1)

line 52 of _operators.py file.

alistarhu avatar Jul 30 '21 09:07 alistarhu