Used VS2017 +OPENCV4.2.0 +cuda10.0+cudnn7.6.5 inference to yolov3 on window10

Hi,
Used VS2017 +OPENCV4.2.0 +cuda10.0+cudnn7.6.5 inference to yolov3 on window10 ,GPU: RTX2070
tested bug :

net.setPreferableBackend(DNN_BACKEND_CUDA);
net.setPreferableTarget(DNN_TARGET_CUDA);
0x00007FFD17B04048(located at test2.exe )There are unhandled exceptions: Microsoft C++ exceptions: cv::dnn::cuda4dnn::csl::CUDAException,In memory location 0x000000FE94BADDD0 。

Thanks

Hi,

Could you please share the script and model file so we can help better?

Thanks

String name_file = “obj.names”;
String model_def = “yolov3_1.cfg”;
String model_weights = “yolov3_1_60000.weights”
string img_path = “pei010718.jpg”;
vector names;
glob(img_path,names);
//string imgname = “guo_0_img60”;
//string img_path = imgname.append(".jpg");
Net net = readNetFromDarknet(model_def, model_weights);
//net.setPreferableBackend(DNN_BACKEND_OPENCV);
//net.setPreferableTarget(DNN_TARGET_CPU);
net.setPreferableBackend(DNN_BACKEND_CUDA);
net.setPreferableTarget(DNN_TARGET_CUDA);
for (int i = 0; i < names.size(); i++)
{
double time0 = static_cast(getTickCount());
string imgname(names[i], 0, 11);
cout << imgname << endl;
string img_path = names[i];

	//read names
	ifstream ifs(name_file.c_str());
	string line;
	while (getline(ifs, line)) classes.push_back(line);

	//inti model

	//读图片
	//#ifdef Image
	//read image and forward
	//double time0 = static_cast<double>(getTickCount());
	Mat frame, blob;

	if ((_access(img_path.c_str(), 0)) == -1)
	{
		cerr << "file:" << img_path.c_str() << "not exist" << endl;
		return -1;
	}
	frame = imread(img_path);
	//Create a 4D blob from a frame.
	blobFromImage(frame, blob, 1 / 255.0, cvSize(inpWidth, inpHeight), Scalar(0, 0, 0), true, false);


	//Sets the input to the network
	net.setInput(blob);

	//Runs the forward pass to get output of the output layers
	vector<Mat> outs;

	net.forward(outs, getOutputsNames(net));

Hi,

Can you provide cudnn API log for this error?
It could be generated through:
https://docs.nvidia.com/deeplearning/sdk/cudnn-developer-guide/index.html#api-logging

Thanks