You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/14 10:59:33 UTC
[GitHub] xiaojingxie opened a new issue #12159: C++ api
executor->Forward(false) is much slower than MXPredForward?
xiaojingxie opened a new issue #12159: C++ api executor->Forward(false) is much slower than MXPredForward?
URL: https://github.com/apache/incubator-mxnet/issues/12159
## Description
hi,
I am using the c++ api for prediction based on mobilenet v2. And I found that the codes belows runs 100+ms while I implement the same function using the c api, 10ms only. Both are running on GPU.
c++ version:
executor = net.SimpleBind(global_ctx, args_map, map<string, NDArray>(),
map<string, OpReqType>(), aux_map);
executor->Forward(false); // around 110ms
c version:
MXPredCreate((const char *) json_data.GetBuffer(),
(const char *) param_data.GetBuffer(),
static_cast<size_t>(param_data.GetLength()),
dev_type,
dev_id,
num_input_nodes,
input_keys,
input_shape_indptr,
input_shape_data,
&pred_hnd);
MXPredSetInput(pred_hnd, "data", image_data.data(), image_size);
// Do Predict Forward
MXPredForward(pred_hnd); // 10ms
Is there something that i am doing wrong?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services