I was trying to import one of the following models from the ONNX github page:
https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/mask-rcnn https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/faster-rcnn
with the function readNetFromONNX(). In Visual Studio just throws an exception and cannot load the models properly.
Unhandled exception at 0x00007FF9A86300F6 (opencv_world420.dll) in inferenceONNX.exe: 0xC0000005: Access violation reading location 0x000022D857CFD6FD. Exception thrown at 0x00007FF9A86300F6 (opencv_world420.dll) in inferenceONNX.exe: 0xC0000005: Access violation reading location 0x000022D857CFD6FD.
My version of opencv is 4.2.0 and the onnx models have a 1.5 version. What am I doing wrong? Should I upgrade to 4.3.0 version?
Thank you for your attention
The code, if helps:
std::string onnxFile = "model/faster_rcnn_R_50_FPN_1x.onnx"; Not working
//std::string onnxFile = "model/mask_rcnn_R_50_FPN_1x.onnx"; Not working
//std::string onnxFile = "model/resnet34v1.onnx"; Loads correctly, v1.2.1
// Load the network
cv::dnn::Net net = cv::dnn::readNetFromONNX(onnxFile);
User contributions licensed under CC BY-SA 3.0