Hi friends,
I am having some problem with MXPredReshape(). I tried to reshape the input to a larger size but the function always returns -1. The code is given below. I am not sure what went wrong since there is not error hints. Any suggestion is highly appreciated. Thanks.
– J
// create Predictor
mx_uint num_input_nodes = 1; // 1 for feedforward
const char* input_key[1] = {"data"};
const char** input_keys = input_key;
const mx_uint input_shape_indptr[2] = { 0, 4 };
const mx_uint input_shape_data[4] = { batch_size, input_depth, input_height, input_width };
MXPredCreatePartialOut( (const char*)model_buf.GetBuffer(),
(const char*)param_buf.GetBuffer(),
static_cast<size_t >(param_buf.GetLength()),
device_type,
device_id,
num_input_nodes,
input_keys,
input_shape_indptr,
input_shape_data,
0,
NULL,
&pred_hnd);
if (!pred_hnd) {
LOG(ERROR) << "Fail to create MXNet predictor";
return false;
}
PredictorHandle reshaped_pred_hnd = NULL;
const mx_uint new_input_shape_data[4] = { batch_size, input_depth, 512, 512 };
int ret = MXPredReshape(num_input_nodes,
input_keys,
input_shape_indptr,
new_input_shape_data,
pred_hnd,
&reshaped_pred_hnd);