Fix TensorFlow split layer
This commit is contained in:
parent
2a2537725a
commit
2a21c10837
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user