mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #13887 from dkurt:dnn_ie_lrn_bug
This commit is contained in:
@@ -90,9 +90,9 @@ public:
|
||||
|
||||
virtual bool supportBackend(int backendId) CV_OVERRIDE
|
||||
{
|
||||
return backendId == DNN_BACKEND_OPENCV ||
|
||||
backendId == DNN_BACKEND_HALIDE ||
|
||||
backendId == DNN_BACKEND_INFERENCE_ENGINE;
|
||||
if (backendId == DNN_BACKEND_INFERENCE_ENGINE)
|
||||
return (bias == 1) && (preferableTarget != DNN_TARGET_MYRIAD || type == SPATIAL_NRM);
|
||||
return backendId == DNN_BACKEND_OPENCV || backendId == DNN_BACKEND_HALIDE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
@@ -382,10 +382,13 @@ public:
|
||||
virtual Ptr<BackendNode> initInfEngine(const std::vector<Ptr<BackendWrapper> >&) CV_OVERRIDE
|
||||
{
|
||||
#ifdef HAVE_INF_ENGINE
|
||||
float alphaSize = alpha;
|
||||
if (!normBySize)
|
||||
alphaSize *= (type == SPATIAL_NRM ? size*size : size);
|
||||
#if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2018R5)
|
||||
InferenceEngine::Builder::NormLayer ieLayer(name);
|
||||
ieLayer.setSize(size);
|
||||
ieLayer.setAlpha(alpha);
|
||||
ieLayer.setAlpha(alphaSize);
|
||||
ieLayer.setBeta(beta);
|
||||
ieLayer.setAcrossMaps(type == CHANNEL_NRM);
|
||||
|
||||
@@ -402,7 +405,7 @@ public:
|
||||
ieLayer->_size = size;
|
||||
ieLayer->_k = (int)bias;
|
||||
ieLayer->_beta = beta;
|
||||
ieLayer->_alpha = alpha;
|
||||
ieLayer->_alpha = alphaSize;
|
||||
ieLayer->_isAcrossMaps = (type == CHANNEL_NRM);
|
||||
return Ptr<BackendNode>(new InfEngineBackendNode(ieLayer));
|
||||
#endif
|
||||
|
||||
@@ -227,7 +227,7 @@ void InfEngineBackendNet::addLayer(InferenceEngine::Builder::Layer& layer)
|
||||
// By default, all the weights are connected to last ports ids.
|
||||
for (int i = 0; i < blobsIds.size(); ++i)
|
||||
{
|
||||
netBuilder.connect((size_t)blobsIds[i], {(size_t)id, portIds[i]});
|
||||
netBuilder.connect((size_t)blobsIds[i], {(size_t)id, (size_t)portIds[i]});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user