opencv: [dnn] Unknown layer type Square in op netvlad/l2_normalize/Square
System information (version)
- OpenCV: master
- SO: Windows 64 Bit
- Compiler: Visual Studio 2015
- Module Opencv: dnn
Error description
During the loading of tf model cv::dnn::Net net = cv::dnn::readNetFromTensorflow(modelFile);
I get this error, related to the l2_normalize layer:
“Unknown layer type Square in op netvlad/l2_normalize/Square”
How can solve it? Can I merge or define a layer like “FusedBatchNorm” for obtain the “L2Normalize” layer? I’m asking for this solution because I have seen that during the populateNet function in tf_importer.cpp there is a layer defined “L2Normalize” but it doesn t enter into the L2normalize’s if because it searching for the “Square” layer that isn t defined.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (8 by maintainers)
Update @dkurt thanks for the reply in #11023 ; I don’t want to “spam” in OE-4 “OpenCV 4.0” discussion so I answer here. I’m trying to use your class cv::dnn::NormalizeBBoxLayer suggested but the problem is refered during the
cv::dnn::readNetFromTensorflow(modelFile)
. L2_normalize layer in my model isn’t the last layer so I can’t cut my model and using NormalizeBBoxLayer for normalize the result of the network. After the L2normalization my model does some convolution and so on.The problem is that some layer like L2normalize isn t supported but I have seen that in tf_importer.cpp there is a L2Normalize layer defined. Thanks again for your support.
@DavideCatto, the problem is that we try to focus on image processing and it’s hard to support general cases like that. I’ll try to make this particular example work again.