Ncnn: Extractor seems not support one input with muti-branch ouput

Created on 9 Apr 2018  ·  2Comments  ·  Source: Tencent/ncnn

Extractor::extract(int blob_index, Mat& feat) seems not support one input with muti-branch ouput, the cnn architecture is looks like
x
can I extract both conv5-1 and conv5-2 output which means only run extract(method) once?
thanks.

Most helpful comment

the common practice

ncnn::Mat conv51;
ex.extract("conv5-1", conv51);

ncnn::Mat conv52;
ex.extract("conv5-2", conv52);

there's some smart logic behind each extract method
the first call will do inference from the graph beginning to conv5-1, but keep the intermediate prelu4 blob (in both light mode and non-light mode)
the second call will do inference from prelu4 to conv5-2
no repeated calculation in your graph at all :)

All 2 comments

the common practice

ncnn::Mat conv51;
ex.extract("conv5-1", conv51);

ncnn::Mat conv52;
ex.extract("conv5-2", conv52);

there's some smart logic behind each extract method
the first call will do inference from the graph beginning to conv5-1, but keep the intermediate prelu4 blob (in both light mode and non-light mode)
the second call will do inference from prelu4 to conv5-2
no repeated calculation in your graph at all :)

excellent solution!

Was this page helpful?
0 / 5 - 0 ratings