-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
can extract be reused? #243
Comments
Net can be reused, as you've shown in <1> |
@nihui ,thanks. |
Creating an Extractor is nearly instantly like allocating an array. |
In mtcnn, there are a few pyramids, can I create a number of pnets to avoid reallocate memory again and again ? |
but i think every time extractor will allocate new memory for intermediate layer output and release it later, this will be bad results for meachine |
<1> below code get correct result;
for(i = 0 ; i < I; i++)
{
ncnn::Extractor Net_ex_ = Net_.create_extractor();
Net_ex_.set_light_mode(true);
}
<2> after i change the code below, can not get correct result, so can bet extract be re-used?In my opinion, net should be independent to data input to net.
ncnn::Extractor Net_ex_ = Net_.create_extractor();
Net_ex_.set_light_mode(true);
for(i = 0 ; i < I; i++)
{
Net_ex_.input("data", input);
Net_ex_.extract("conv3",output);
}
The text was updated successfully, but these errors were encountered: