-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
opencv dnn can't load pytorch FasterRCNN exported to onnx detection model #21634
Copy link
Copy link
Closed
Labels
bugcategory: dnncategory: dnn (onnx)ONNX suport issues in DNN moduleONNX suport issues in DNN moduleconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation complete
Milestone
Description
Environment:
- OpenCV => 4.5.5
- Operating System / Platform => Windows10 64 Bit
- pytorch 1.7
- python 3.7
export pytorch model to onnx code:
`
onnx_model_path = "./fasterrcnn_resnet50_fpn.onnx"
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)
device = torch.device('cpu')
model.to(device)
dummy_input = torch.randn(1, 3, 608, 608).to(device)
model.eval()
torch.onnx.export(model, dummy_input, onnx_model_path, verbose=False, opset_version=11)
`
In opencv load onnx model code:
net = cv2.dnn.readNetFromONNX(onnx_model_path)
report error:
net = cv2.dnn.readNetFromONNX(onnx_model_path)
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\graph_simplifier.cpp:76: error: (-212:Parsing error) Input node with name 1625 not found in function 'cv::dnn::Subgraph::getInputNodeId'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcategory: dnncategory: dnn (onnx)ONNX suport issues in DNN moduleONNX suport issues in DNN moduleconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation complete