Skip to content

Commit

Permalink
Merge pull request opencv#23287 from alalek:dnn_tflite_fix_illegal_ac…
Browse files Browse the repository at this point in the history
…cess
  • Loading branch information
alalek committed Feb 22, 2023
2 parents 5a22735 + 9eb5e39 commit b3c9842
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/dnn/src/tflite/tflite_importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,8 @@ void TFLiteImporter::parseConcat(const Operator& op, const std::string& opcode,
DataLayout inpLayout = layouts[op.inputs()->Get(0)];
if (inpLayout == DATA_LAYOUT_NHWC) {
// OpenCV works in NCHW data layout. So change the axis correspondingly.
CV_Check(axis, -4 < axis && axis < 4, "");
int remap[] = {0, 2, 3, 1};
axis = axis > 0 ? axis : 4 + axis;
axis = normalize_axis(axis, 4);
static const int remap[] = {0, 2, 3, 1};
axis = remap[axis];
}
layerParams.set("axis", axis);
Expand Down

0 comments on commit b3c9842

Please sign in to comment.