mirror of
https://github.com/opencv/opencv.git
synced 2025-06-18 16:11:50 +08:00
Merge pull request #12025 from Triplesalt:tfimport-relu
This commit is contained in:
commit
c37d1a53b5
@ -1293,7 +1293,13 @@ void TFImporter::populateNet(Net dstNet)
|
|||||||
if (!next_layers.empty())
|
if (!next_layers.empty())
|
||||||
{
|
{
|
||||||
int maximumLayerIdx = next_layers[0].second;
|
int maximumLayerIdx = next_layers[0].second;
|
||||||
ExcludeLayer(net, maximumLayerIdx, 0, false);
|
|
||||||
|
CV_Assert(net.node(maximumLayerIdx).input_size() == 2);
|
||||||
|
|
||||||
|
// The input from the Mul layer can also be at index 1.
|
||||||
|
int mulInputIdx = (net.node(maximumLayerIdx).input(0) == name) ? 0 : 1;
|
||||||
|
|
||||||
|
ExcludeLayer(net, maximumLayerIdx, mulInputIdx, false);
|
||||||
layers_to_ignore.insert(next_layers[0].first);
|
layers_to_ignore.insert(next_layers[0].first);
|
||||||
|
|
||||||
layerParams.set("negative_slope", scaleMat.at<float>(0));
|
layerParams.set("negative_slope", scaleMat.at<float>(0));
|
||||||
|
@ -230,6 +230,13 @@ TEST_P(Test_TensorFlow_layers, flatten)
|
|||||||
runTensorFlowNet("unfused_flatten_unknown_batch");
|
runTensorFlowNet("unfused_flatten_unknown_batch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(Test_TensorFlow_layers, leaky_relu)
|
||||||
|
{
|
||||||
|
runTensorFlowNet("leaky_relu_order1");
|
||||||
|
runTensorFlowNet("leaky_relu_order2");
|
||||||
|
runTensorFlowNet("leaky_relu_order3");
|
||||||
|
}
|
||||||
|
|
||||||
TEST_P(Test_TensorFlow_layers, l2_normalize)
|
TEST_P(Test_TensorFlow_layers, l2_normalize)
|
||||||
{
|
{
|
||||||
runTensorFlowNet("l2_normalize");
|
runTensorFlowNet("l2_normalize");
|
||||||
|
Loading…
Reference in New Issue
Block a user