Merge pull request #10244 from dkurt:issue_10239

pull/10253/head
Alexander Alekhin 7 years ago
commit 0be1bf551b
  1. 1
      modules/dnn/perf/perf_net.cpp
  2. 4
      modules/dnn/src/layers/convolution_layer.cpp
  3. 2
      modules/dnn/src/layers/fully_connected_layer.cpp

@ -87,6 +87,7 @@ public:
size_t weightsMemory = 0, blobsMemory = 0; size_t weightsMemory = 0, blobsMemory = 0;
net.getMemoryConsumption(netInputShape, weightsMemory, blobsMemory); net.getMemoryConsumption(netInputShape, weightsMemory, blobsMemory);
int64 flops = net.getFLOPS(netInputShape); int64 flops = net.getFLOPS(netInputShape);
CV_Assert(flops > 0);
net.forward(outputLayer); // warmup net.forward(outputLayer); // warmup

@ -1022,7 +1022,7 @@ public:
int64 flops = 0; int64 flops = 0;
for (int i = 0; i < inputs.size(); i++) for (int i = 0; i < inputs.size(); i++)
{ {
flops += total(outputs[i])*(2*kernel.area()*inputs[i][1] + 1); flops += total(outputs[i])*(CV_BIG_INT(2)*kernel.area()*inputs[i][1] + 1);
} }
return flops; return flops;
@ -1440,7 +1440,7 @@ public:
for (int i = 0; i < inputs.size(); i++) for (int i = 0; i < inputs.size(); i++)
{ {
flops += 2*outChannels*kernel.area()*total(inputs[i]); flops += CV_BIG_INT(2)*outChannels*kernel.area()*total(inputs[i]);
} }
return flops; return flops;

@ -397,7 +397,7 @@ public:
int innerSize = blobs[0].size[1]; int innerSize = blobs[0].size[1];
for(int i = 0; i < outputs.size(); i++) for(int i = 0; i < outputs.size(); i++)
{ {
flops += 3*innerSize*total(outputs[i]); flops += CV_BIG_INT(3)*innerSize*total(outputs[i]);
} }
return flops; return flops;

Loading…
Cancel
Save