Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extractor seems not support one input with muti-branch ouput #343

Closed
Pinnh opened this issue Apr 9, 2018 · 2 comments
Closed

Extractor seems not support one input with muti-branch ouput #343

Pinnh opened this issue Apr 9, 2018 · 2 comments

Comments

@Pinnh
Copy link

Pinnh commented Apr 9, 2018

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.

@nihui
Copy link
Member

nihui commented Apr 9, 2018

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 :)

@Pinnh
Copy link
Author

Pinnh commented Apr 9, 2018

excellent solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants