c++预测时提示输出tensor不可以reshape
Created by: yangzhifeng-stat
fluid 1.6.0版本,用c++加载模型预测。
--- Running analysis [ir_graph_build_pass]
--- Running analysis [ir_analysis_pass]
--- Running IR pass [infer_clean_graph_pass]
--- Running IR pass [attention_lstm_fuse_pass]
--- Running IR pass [seqconv_eltadd_relu_fuse_pass]
--- Running IR pass [fc_lstm_fuse_pass]
--- Running IR pass [mul_lstm_fuse_pass]
--- Running IR pass [fc_gru_fuse_pass]
--- Running IR pass [mul_gru_fuse_pass]
--- Running IR pass [seq_concat_fc_fuse_pass]
--- Running IR pass [fc_fuse_pass]
--- detected 5 subgraphs
--- Running IR pass [repeated_fc_relu_fuse_pass]
--- Running IR pass [squared_mat_sub_fuse_pass]
--- Running IR pass [conv_bn_fuse_pass]
--- Running IR pass [conv_eltwiseadd_bn_fuse_pass]
--- Running IR pass [is_test_pass]
--- Running IR pass [runtime_context_cache_pass]
--- Running analysis [ir_params_sync_among_devices_pass]
--- Running analysis [adjust_cudnn_workspace_size_pass]
--- Running analysis [inference_op_replace_pass]
--- Running analysis [ir_graph_to_program_pass]
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1119 15:07:43.434036 28762 analysis_predictor.cc:451] == optimize end ==
--- skip [feed], feed -> dense_data
--- skip [feed], feed -> sparse_data
--- skip [save_infer_model/scale_0], fetch -> fetch
--- skip [save_infer_model/scale_1], fetch -> fetch
terminate called after throwing an instance of 'paddle::platform::EnforceNotMet'
what(): Can't reshape the output tensor, it is readonly at [/paddle/paddle/fluid/inference/api/details/zero_copy_tensor.cc:28]
PaddlePaddle Call Stacks:
0 0x7fb30fe57b83p void paddle::platform::EnforceNotMet::Init<char const*>(char const*, char const*, int) + 563
1 0x7fb30fe582e9p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 137
2 0x7fb30fe74e10p paddle::ZeroCopyTensor::Reshape(std::vector<int, std::allocator<int> > const&) + 720
3 0x401a8ep
4 0x402069p
5 0x7fb30e84bbd5p __libc_start_main + 245
6 0x401529p
Aborted