Skip to content

Commit b0bce60

Browse files
committed
Merge pull request opencv#10284 from alalek:dnn_debug_error
2 parents 5404930 + eff42f6 commit b0bce60

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

modules/dnn/src/layers/max_unpooling_layer.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Implementation of Batch Normalization layer.
1414
#include "op_halide.hpp"
1515
#include <opencv2/dnn/shape_utils.hpp>
1616

17+
#include <iostream>
18+
1719
namespace cv
1820
{
1921
namespace dnn
@@ -94,7 +96,20 @@ class MaxUnpoolLayerImpl : public MaxUnpoolLayer
9496
for(int i_wh = 0; i_wh < wh_area; i_wh++)
9597
{
9698
int index = idxptr[i_wh];
97-
CV_Assert(0 <= index && index < outPlaneTotal);
99+
if (!(0 <= index && index < outPlaneTotal))
100+
{
101+
std::cerr
102+
<< "i_n=" << i_n << std::endl
103+
<< "i_c=" << i_c << std::endl
104+
<< "i_wh=" << i_wh << std::endl
105+
<< "index=" << index << std::endl
106+
<< "outPlaneTotal=" << outPlaneTotal << std::endl
107+
<< "input.size=" << input.size << std::endl
108+
<< "indices.size=" << indices.size << std::endl
109+
<< "outBlob=" << outBlob.size << std::endl
110+
;
111+
CV_Assert(0 <= index && index < outPlaneTotal);
112+
}
98113
outptr[index] = inptr[i_wh];
99114
}
100115
}

0 commit comments

Comments
 (0)