Fix dnn caffe importer extract blobs from reused layers

pull/12775/head
Adam Radomski 6 years ago
parent 78a802baae
commit cc3ec5d453
  1. 6
      modules/dnn/src/caffe/caffe_importer.cpp

@ -278,11 +278,13 @@ public:
int li; int li;
for (li = 0; li != netBinary.layer_size(); li++) for (li = 0; li != netBinary.layer_size(); li++)
{ {
if (netBinary.layer(li).name() == name) const caffe::LayerParameter& binLayer = netBinary.layer(li);
// Break if the layer name is the same and the blobs are not cleared
if (binLayer.name() == name && binLayer.blobs_size() != 0)
break; break;
} }
if (li == netBinary.layer_size() || netBinary.layer(li).blobs_size() == 0) if (li == netBinary.layer_size())
return; return;
caffe::LayerParameter* binLayer = netBinary.mutable_layer(li); caffe::LayerParameter* binLayer = netBinary.mutable_layer(li);

Loading…
Cancel
Save