-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Unsupported data type: BOOL in function 'getMatFromTensor' after call readNetFromONNX (TensorFlow -> ONNX) #19366
Copy link
Copy link
Open
Labels
category: dnncategory: dnn (onnx)ONNX suport issues in DNN moduleONNX suport issues in DNN moduleconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation completefeaturepriority: low
Description
System information (version)
- OpenCV => 4.5.1.48
- Operating System / Platform => Google Colab
Detailed description
I've got the following error:
OpenCV(4.5.1) /tmp/pip-req-build-1syr35c1/opencv/modules/dnn/src/onnx/onnx_graph_simplifier.cpp:592: error: (-210:Unsupported format or combination of formats) Unsupported data type: BOOL in function 'getMatFromTensor'
because in onnx_graph_simplifier.cpp the TensorProto_DataType_BOOL isn't mentioned, will it be added soon?
The model I converted is Mask R-CNN Inception Resnet V2, you can download it from this link:
I trained it with TensorFlow 2, I've used the saved_model format and converted it to ONNX doing the following:
Steps to reproduce
pip install tf2onnx
pip install opencv-python==4.5.1.48
python -m tf2onnx.convert --saved-model /path/to/saved_model/dir/ --opset 13 --output /path/to/model.onnx
import cv2
net = cv2.dnn.readNetFromONNX('/path/to/model.onnx') #This is where the error raises
image = cv2.imread("/path/to/image_example.jpg")
blob = cv2.dnn.blobFromImage(image)
net.setInput(blob)
net.forward()
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category: dnncategory: dnn (onnx)ONNX suport issues in DNN moduleONNX suport issues in DNN moduleconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation completefeaturepriority: low