You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a model in tensorflow and converted it to onnx with tf2onnx.
It seems like the interpreter cannot parse the gather node.
The following error is thown on cv::dnn::readNetFromONNX(..):
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp (602) cv::dnn::dnn4_v20211004::ONNXImporter::populateNet DNN/ONNX: loading ONNX v7 model produced by 'tf2onnx':1.10.0. Number of nodes = 212, inputs = 1, outputs = 1
OpenCV(4.5.4) Error: Assertion failed (indexMat.total() == 1) in cv::dnn::dnn4_v20211004::ONNXImporter::parseGather, file C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp, line 2200
[ERROR:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp (720) cv::dnn::dnn4_v20211004::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 1 outputs: [Gather]:(Shape__224:0)
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp (724) cv::dnn::dnn4_v20211004::ONNXImporter::handleNode Input[0] = 'Shape__820:0'
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp (724) cv::dnn::dnn4_v20211004::ONNXImporter::handleNode Input[1] = 'Const__872'
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp (728) cv::dnn::dnn4_v20211004::ONNXImporter::handleNode Output[0] = 'Shape__224:0'
OpenCV(4.5.4) Error: Unspecified error (> Node [Gather]:(Shape__224:0) parse error: OpenCV(4.5.4) C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp:2200: error: (-215:Assertion failed) indexMat.total() == 1 in function 'cv::dnn::dnn4_v20211004::ONNXImporter::parseGather'
> ) in cv::dnn::dnn4_v20211004::ONNXImporter::handleNode, file C:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp, line 739
Convertion was performed using this command: python -m tf2onnx.convert --keras .\saved_model\ --output .\models\tf2onnx_keras.onnx --opset 14
System information (version)
Detailed description
I have created a model in tensorflow and converted it to onnx with tf2onnx.
It seems like the interpreter cannot parse the gather node.
The following error is thown on cv::dnn::readNetFromONNX(..):
Convertion was performed using this command:
python -m tf2onnx.convert --keras .\saved_model\ --output .\models\tf2onnx_keras.onnx --opset 14
Here the node from the error log. netron.app.
Steps to reproduce
Onnx model:
tf2onnx_keras.zip
The Code:
Issue submission checklist
forum.opencv.org, Stack Overflow, etc and have not found solution
The text was updated successfully, but these errors were encountered: