-
-
Notifications
You must be signed in to change notification settings - Fork 55.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No attribute axes in reduce onnx layer with opset13 #25118
Comments
It has been taken care of in onnx importer: opencv/modules/dnn/src/onnx/onnx_importer.cpp Lines 1187 to 1194 in 8f83540
|
Yes but it's not a constBlob. axis is a layer : again output shape is known only at inference time |
In this case, dnn does not support for now. Output shape needs to be determined before forward. |
@fengyuentau |
What is this? I do not recommand manual changes on dimensions since you do not have tools to check whether you do it in a correct way. |
@LaurentBerger, is the reproducer illustrative case of some real word model issue when the axis is given at inference time as input? I understand that currently, OpenCV only supports axis as an attribute. |
System Information
opencv 4.9
Detailed description
There is no attribute axes in all reduce layers since onnx version 13
reduce axes is given using an input
In current opencv version if there is no attribute axes all axes are reduce
opencv/modules/dnn/src/layers/reduce_layer.cpp
Lines 46 to 53 in 8f83540
Steps to reproduce
input DATA
[[[[[ 0. 1. 2. 3. 4.]
[ 5. 6. 7. 8. 9.]
[ 10. 11. 12. 13. 14.]
[ 15. 16. 17. 18. 19.]]
[[ 20. 21. 22. 23. 24.]
[ 25. 26. 27. 28. 29.]
[ 30. 31. 32. 33. 34.]
[ 35. 36. 37. 38. 39.]]
[[ 40. 41. 42. 43. 44.]
[ 45. 46. 47. 48. 49.]
[ 50. 51. 52. 53. 54.]
[ 55. 56. 57. 58. 59.]]]
[[[ 60. 61. 62. 63. 64.]
[ 65. 66. 67. 68. 69.]
[ 70. 71. 72. 73. 74.]
[ 75. 76. 77. 78. 79.]]
[[ 80. 81. 82. 83. 84.]
[ 85. 86. 87. 88. 89.]
[ 90. 91. 92. 93. 94.]
[ 95. 96. 97. 98. 99.]]
[[100. 101. 102. 103. 104.]
[105. 106. 107. 108. 109.]
[110. 111. 112. 113. 114.]
[115. 116. 117. 118. 119.]]]]]
ONNX result
[[[[20. 21. 22. 23. 24.]
[25. 26. 27. 28. 29.]
[30. 31. 32. 33. 34.]
[35. 36. 37. 38. 39.]]
[[80. 81. 82. 83. 84.]
[85. 86. 87. 88. 89.]
[90. 91. 92. 93. 94.]
[95. 96. 97. 98. 99.]]]]
Writting model
Reading model
Set opencv input DATA
Opencv result. Shape = (1, 1)
[[59.5]]
Quadratic error for node : 933.25
Max error for node : 1560.25
Issue submission checklist
The text was updated successfully, but these errors were encountered: