Commit 5f6ce6f4 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #9762 from dkurt:fix_tensorflow_split_layer

parents 558e4d9c 2a21c108
......@@ -116,7 +116,7 @@ public:
}
else // Divide input blob on equal parts by axis.
{
CV_Assert(0 < axis && axis < inpShape.size());
CV_Assert(0 <= axis && axis < inpShape.size());
CV_Assert(requiredOutputs > 0 && inpShape[axis] % requiredOutputs == 0);
inpShape[axis] /= requiredOutputs;
outputs.resize(requiredOutputs, inpShape);
......
......@@ -866,8 +866,6 @@ void TFImporter::populateNet(Net dstNet)
CV_Assert(layer.input_size() == 2);
// num_split
// 1st blob is dims tensor
layerParams.set("slice_point", DictValue::arrayReal((double*)0, 0));
int axis = getConstBlob(layer, value_id, 0).int_val().Get(0);
layerParams.set("axis", toNCHW[axis]);
......
......@@ -170,4 +170,9 @@ TEST(Test_TensorFlow, lstm)
runTensorFlowNet("lstm");
}
TEST(Test_TensorFlow, split)
{
runTensorFlowNet("split_equals");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment