Error Message Summary: ---------------------- InvalidArgumentError: The input tensor's dimension should be equal to or greater than the axis's size. But received input tensor's dimension is 3, axis's size is 4 [Hint: Expected x_rank >= axis_size, but received x_rank:3 < axis_size:4.] (at /paddle/paddle/fluid/operators/transpose_op.cc:52) [operator < transpose2 > error]

7bsow1i6  于 5个月前  发布在  其他
关注(0)|答案(4)|浏览(86)

问题描述 Please describe your issue

#include
#include
#include
#include

#include <gflags/gflags.h>
#include <glog/logging.h>

#include "paddle/include/paddle_inference_api.h"

using paddle_infer::Config;
using paddle_infer::Predictor;
using paddle_infer::CreatePredictor;

DEFINE_string(model_file, "", "Directory of the inference model.");
DEFINE_string(params_file, "", "Directory of the inference model.");
DEFINE_string(model_dir, "", "Directory of the inference model.");
DEFINE_int32(batch_size, 1, "Directory of the inference model.");
DEFINE_int32(warmup, 1, "warmup.");
DEFINE_int32(repeats, 1, "repeats.");
DEFINE_bool(use_ort, false, "use ort.");

using Time = decltype(std::chrono::high_resolution_clock::now());
Time time() { return std::chrono::high_resolution_clock::now(); };
double time_diff(Time t1, Time t2) {
typedef std::chrono::microseconds ms;
auto diff = t2 - t1;
ms counter = std::chrono::duration_cast(diff);
return counter.count() / 1000.0;
}

std::shared_ptr InitPredictor() {
Config config;
if (FLAGS_model_dir != "") {
config.SetModel(FLAGS_model_dir);
}
config.SetModel(FLAGS_model_file, FLAGS_params_file);
if (FLAGS_use_ort) {
config.EnableONNXRuntime();
config.EnableORTOptimization();
} else {
config.EnableMKLDNN();
}

config.EnableMemoryOptim();
return CreatePredictor(config);
}

void run(Predictor *predictor, const std::vector &input,
const std::vector &input_shape, std::vector *out_data) {
int input_num = std::accumulate(input_shape.begin(), input_shape.end(), 1,
std::multiplies());

auto input_names = predictor->GetInputNames();
auto output_names = predictor->GetOutputNames();
auto input_t = predictor->GetInputHandle(input_names[0]);
input_t->Reshape(input_shape);
input_t->CopyFromCpu(input.data());

for (size_t i = 0; i < FLAGS_warmup; ++i)
CHECK(predictor->Run());

auto st = time();
for (size_t i = 0; i < FLAGS_repeats; ++i) {
CHECK(predictor->Run());
auto output_t = predictor->GetOutputHandle(output_names[0]);
std::vector output_shape = output_t->shape();
int out_num = std::accumulate(output_shape.begin(), output_shape.end(), 1,
std::multiplies());
out_data->resize(out_num);
output_t->CopyToCpu(out_data->data());
}
LOG(INFO) << "run avg time is " << time_diff(st, time()) / FLAGS_repeats
<< " ms";
}

void runTwo(Predictor *predictor, const std::vector &input0,
const std::vector &input_shape0, const std::vector &input1,
const std::vector &input_shape1, std::vector *out_data) {
auto input_names = predictor->GetInputNames();
auto output_names = predictor->GetOutputNames();
auto input_t0 = predictor->GetInputHandle(input_names[0]);
input_t0->Reshape(input_shape0);
input_t0->CopyFromCpu(input0.data());

/for (auto name : input_names)
{
LOG(INFO) << "name: " << name;
}
/

auto input_t1 = predictor->GetInputHandle(input_names[1]);
input_t1->Reshape(input_shape1);
input_t1->CopyFromCpu(input1.data());

auto st = time();
for (size_t i = 0; i < FLAGS_warmup; ++i)
{
CHECK(predictor->Run());
/auto output_t = predictor->GetOutputHandle(output_names[0]);
std::vector output_shape = output_t->shape();
int out_num = std::accumulate(output_shape.begin(), output_shape.end(), 1,
std::multiplies());
LOG(INFO) << "out_num: " << out_num;
out_data->resize(out_num);
output_t->CopyToCpu(out_data->data());
/
}
LOG(INFO) << "run avg time is " << time_diff(st, time()) / FLAGS_repeats
<< " ms";
LOG(INFO) << "finished";
}

int main(int argc, char *argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
auto predictor = InitPredictor();
std::vector input_data0 = {
1685000.0, 1684000.0, 1683800.0, 1683600.0, 1683500.0, 1686400.0, 1686500.0, 1686600.0, 1686700.0, 1687000.0, 0.99527466, 0.994684, 0.99456584, 0.9944477, 0.99438864, 0.9961016, 0.9961607, 0.99621975, 0.9962788, 0.99645597, 301.0, 1556.0, 101.0, 401.0, 1001.0, 201.0, 1101.0, 1001.0, 1701.0, 201.0, 0.1992032, 0.17124577, -0.81669694, -0.6184586, 0.6655574, -0.08936344, 1.9010576e-13, 7.727286e-14, 0.42199674};
auto size = input_data0.size();
std::vector input_shape0 = {1, 39};
std::vectorstd::vector tmp_data =
{
{-0.0015423859, -0.048843734, 0.0009491606, 0.26566625, -0.0016017085, 0.49939156, 0.0010084831, 0.49909258, -0.001661031, -0.14474064, 0.0013050959, 0.40060815, -0.0018389986, -0.14474064, 0.0013644183, 0.35863516, -0.0018983212, -0.048843734, 0.0017796761, -0.048843734},
{-0.0015423859, 0.2318443, 0.00088983803, -0.14474064, -0.0016017085, 0.49939156, 0.0009491606, 0.094837494, -0.001661031, -0.14474064, 0.0010084831, 0.49939156, -0.0018389986, -0.14474064, 0.0013050959, 0.40060815, -0.0018983212, -0.048843734, 0.0013644183, 0.35863516},
{-0.0014830634, -0.14474064, 0.0010084831, 0.49170688, -0.0015423859, 0.2318443, 0.0013050959, 0.40060815, -0.0016017085, 0.49939156, 0.0013644183, 0.35863516, -0.0018389986, -0.14474064, 0.0017796761, -0.048843734, -0.0018983212, -0.048843734, 0.0018389986, -0.048843734},
{-0.0014237409, -0.048843734, 0.0010084831, 0.47298563, -0.0015423859, 0.2318443, 0.0013050959, 0.40060815, -0.0016017085, 0.49939156, 0.0013644183, 0.35863516, -0.0018389986, -0.14474064, 0.0017796761, -0.048843734, -0.0018983212, -0.048843734, 0.0018389986, -0.048843734},
{-0.0014237409, 0.1465709, 0.0010084831, 0.481729, -0.0015423859, 0.2318443, 0.0013050959, 0.40060815, -0.0016017085, 0.49939156, 0.0013644183, 0.35863516, -0.0018389986, -0.14474064, 0.0017796761, -0.048843734, -0.0018983212, -0.048843734, 0.0018389986, -0.048843734},
{-0.0014237409, 0.1465709, 0.0010084831, 0.48767835, -0.0015423859, 0.2318443, 0.0013050959, 0.40060815, -0.0016017085, 0.49939156, 0.0013644183, 0.40060815, -0.0018389986, -0.14474064, 0.0017796761, -0.048843734, -0.0018983212, -0.048843734, 0.0018389986, -0.048843734},
{-0.0014237409, 0.050823864, 0.0010084831, 0.47298563, -0.0014830634, -0.14474064, 0.0013050959, 0.40060815, -0.0015423859, 0.2318443, 0.0013644183, 0.40060815, -0.0016017085, 0.49939156, 0.0017796761, -0.048843734, -0.0018389986, -0.14474064, 0.0018389986, -0.048843734},
{-0.0014237409, -0.048843734, 0.0010084831, 0.4602277, -0.0014830634, -0.14474064, 0.0013050959, 0.40060815, -0.0015423859, 0.2318443, 0.0013644183, 0.40060815, -0.0016017085, 0.49939156, 0.0017796761, -0.048843734, -0.0018389986, -0.14474064, 0.0018389986, -0.048843734},
{-0.0014237409, 0.050823864, 0.0010084831, 0.44180506, -0.0015423859, 0.2318443, 0.0011271281, -0.14474064, -0.0016017085, 0.49939156, 0.0013050959, 0.40060815, -0.0018389986, -0.14474064, 0.0013644183, 0.35863516, -0.0018983212, -0.048843734, 0.0017796761, -0.048843734},
{-0.0014237409, 0.050823864, 0.0010084831, 0.18654156, -0.0015423859, 0.2318443, 0.0011271281, -0.14474064, -0.0016017085, 0.49939156, 0.0013050959, 0.40060815, -0.0018389986, -0.14474064, 0.0013644183, 0.35863516, -0.0018983212, -0.048843734, 0.0017796761, -0.048843734},
{-0.0014237409, 0.050823864, 0.0010084831, 0.18654156, -0.0014830634, 0.050823864, 0.0011271281, -0.14474064, -0.0015423859, 0.49008754, 0.0013050959, 0.40060815, -0.0016017085, 0.49939156, 0.0013644183, 0.35863516, -0.001661031, -0.14474064, 0.0017796761, -0.048843734},
{-0.0014237409, -0.048843734, 0.0010084831, 0.18654156, -0.0014830634, 0.050823864, 0.0011271281, -0.14474064, -0.0015423859, 0.49008754, 0.0011864507, -0.14474064, -0.0016017085, 0.49939156, 0.0013050959, 0.40060815, -0.001661031, -0.14474064, 0.0013644183, 0.35863516},
{-0.0014237409, -0.048843734, 0.0010084831, 0.32977027, -0.0014830634, 0.050823864, 0.0011271281, -0.14474064, -0.0015423859, 0.4969936, 0.0011864507, -0.14474064, -0.0016017085, 0.49959207, 0.0013050959, 0.40060815, -0.0018389986, -0.14474064, 0.0013644183, 0.30281785},
{-0.0014237409, -0.048843734, 0.00088983803, -0.048843734, -0.0014830634, 0.2318443, 0.0010084831, 0.32977027, -0.0015423859, 0.4969936, 0.0011271281, -0.14474064, -0.0016017085, 0.4955216, 0.0011864507, -0.14474064, -0.0018389986, -0.14474064, 0.0013050959, 0.40060815},
{-0.0012457733, -0.14474064, 0.00088983803, -0.14474064, -0.0014237409, -0.048843734, 0.0010084831, 0.32977027, -0.0014830634, 0.5, 0.0011271281, -0.14474064, -0.0015423859, 0.4969936, 0.0011864507, -0.14474064, -0.0016017085, 0.4955216, 0.0013050959, 0.40060815},
{-0.0014237409, 0.1465709, 0.00088983803, 0.050823864, -0.0014830634, 0.5, 0.0010084831, 0.26566625, -0.0015423859, 0.4969936, 0.0011271281, -0.14474064, -0.0016017085, 0.4955216, 0.0011864507, -0.14474064, -0.0018389986, -0.14474064, 0.0013050959, 0.40060815},
{-0.0013644183, -0.048843734, 0.00088983803, 0.050823864, -0.0014237409, 0.1465709, 0.0010084831, 0.3791069, -0.0014830634, 0.5, 0.0011271281, -0.14474064, -0.0015423859, 0.4969936, 0.0011864507, -0.14474064, -0.0016017085, 0.4955216, 0.0013050959, 0.40060815},
{-0.0014237409, -0.14474064, 0.00088983803, 0.1465709, -0.0014830634, 0.5, 0.0010084831, 0.3791069, -0.0015423859, 0.4969936, 0.0011271281, -0.14474064, -0.0016017085, 0.4955216, 0.0011864507, -0.14474064, -0.0018389986, -0.14474064, 0.0013050959, 0.40060815},
{-0.0014237409, -0.048843734, 0.0008305155, 0.2318443, -0.0014830634, 0.5, 0.00088983803, 0.1465709, -0.0015423859, 0.4969936, 0.0010084831, 0.3791069, -0.0016017085, 0.49939156, 0.0011271281, -0.14474064, -0.0018389986, -0.14474064, 0.0011864507, -0.14474064},
{-0.0014237409, 0.050823864, 0.0008305155, 0.35863516, -0.0014830634, 0.5, 0.00088983803, 0.050823864, -0.0015423859, 0.4969936, 0.0010084831, 0.18654156, -0.0016017085, 0.49939156, 0.0011271281, -0.14474064, -0.0018389986, -0.14474064, 0.0011864507, -0.14474064},
{-0.0014237409, 0.050823864, 0.00077119295, 0.050823864, -0.0014830634, 0.5, 0.0008305155, 0.1465709, -0.0015423859, 0.49798274, 0.00088983803, 0.050823864, -0.0016017085, 0.49939156, 0.0010084831, 0.18654156, -0.0018983212, -0.048843734, 0.0011271281, -0.14474064},
{-0.0014237409, 0.050823864, 0.00077119295, 0.050823864, -0.0014830634, 0.5, 0.0008305155, 0.1465709, -0.0015423859, 0.49798274, 0.00088983803, 0.050823864, -0.0016017085, 0.49939156, 0.0010084831, 0.18654156, -0.0018983212, -0.048843734, 0.0011271281, -0.14474064},
{-0.0013644183, -0.048843734, 0.00077119295, 0.050823864, -0.0014237409, 0.050823864, 0.0008305155, 0.1465709, -0.0014830634, 0.5, 0.00088983803, 0.050823864, -0.0015423859, 0.4969936, 0.0010084831, 0.18654156, -0.0016017085, 0.49939156, 0.0011271281, -0.14474064},
{-0.0013644183, 0.050823864, 0.00077119295, 0.050823864, -0.0014237409, 0.4527545, 0.0008305155, 0.1465709, -0.0014830634, 0.5, 0.00088983803, 0.050823864, -0.0015423859, 0.4969936, 0.0010084831, 0.18654156, -0.0016017085, 0.49939156, 0.0011271281, -0.14474064},
{0.00077119295, 0.2318443, 0.0008305155, 0.1465709, -0.0013644183, 0.050823864, 0.00088983803, -0.14474064, -0.0014237409, 0.4527545, 0.0010084831, -0.0039999145, -0.0014830634, 0.5, 0.0011271281, -0.14474064, -0.0015423859, 0.4969936, 0.0011864507, -0.14474064},
{-0.0013644183, 0.050823864, 0.00077119295, 0.4527545, -0.0014237409, 0.4527545, 0.0008305155, 0.1465709, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.4969936, 0.0010084831, -0.0039999145, -0.0016017085, 0.49939156, 0.0011271281, -0.14474064},
{-0.0013644183, 0.1465709, 0.00077119295, 0.4527545, -0.0014237409, 0.4527545, 0.0008305155, 0.1465709, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.49798274, 0.0010084831, -0.0039999145, -0.0016017085, 0.49939156, 0.0011271281, -0.14474064},
{-0.0013050959, -0.14474064, 0.00071187044, -0.14474064, -0.0013644183, 0.1465709, 0.00077119295, 0.4527545, -0.0014237409, 0.4527545, 0.0008305155, 0.1465709, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.49798274, 0.0010084831, -0.0039999145},
{-0.0013050959, -0.14474064, 0.00071187044, -0.14474064, -0.0013644183, 0.1465709, 0.00077119295, 0.4527545, -0.0014237409, 0.4527545, 0.0008305155, -0.048843734, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.4969936, 0.0010084831, -0.0039999145},
{-0.0013050959, -0.14474064, 0.00071187044, -0.048843734, -0.0013644183, 0.1465709, 0.00077119295, 0.4527545, -0.0014237409, 0.4527545, 0.0008305155, -0.048843734, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.4969936, 0.0010084831, -0.0039999145},
{-0.0013050959, 0.050823864, 0.00071187044, -0.14474064, -0.0013644183, 0.1465709, 0.00077119295, 0.43111858, -0.0014237409, 0.4527545, 0.0008305155, -0.048843734, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.4969936, 0.0010084831, -0.0039999145},
{-0.0013050959, 0.050823864, 0.00071187044, -0.14474064, -0.0013644183, 0.30281785, 0.00077119295, 0.4527545, -0.0014237409, 0.4527545, 0.0008305155, -0.048843734, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.4969936, 0.0010084831, -0.0039999145},
{-0.0012457733, -0.048843734, 0.00071187044, -0.14474064, -0.0013050959, -0.048843734, 0.00077119295, 0.4527545, -0.0013644183, 0.43111858, 0.0008305155, -0.048843734, -0.0014237409, 0.46782932, 0.00088983803, -0.14474064, -0.0014830634, 0.5, 0.0010084831, -0.0039999145},
{-0.0012457733, -0.14474064, 0.00071187044, -0.14474064, -0.0013644183, 0.4527545, 0.00077119295, 0.4527545, -0.0014237409, 0.46782932, 0.0008305155, -0.048843734, -0.0014830634, 0.5, 0.00088983803, -0.14474064, -0.0015423859, 0.4969936, 0.0010084831, -0.0039999145},
{-0.0011864507, 0.050823864, 0.0006525479, -0.048843734, -0.0012457733, -0.048843734, 0.00071187044, -0.14474064, -0.0013644183, 0.49008754, 0.00077119295, 0.4527545, -0.0014237409, 0.49008754, 0.0008305155, -0.048843734, -0.0014830634, 0.5, 0.00088983803, -0.14474064},
{-0.0011271281, -0.14474064, 0.0006525479, -0.048843734, -0.0011864507, 0.050823864, 0.00071187044, -0.14474064, -0.0012457733, -0.048843734, 0.00077119295, 0.43111858, -0.0013644183, 0.4852841, 0.0008305155, -0.048843734, -0.0014237409, 0.49008754, 0.00088983803, -0.14474064},
{-0.0011271281, -0.14474064, 0.0006525479, -0.048843734, -0.0011864507, 0.050823864, 0.00071187044, -0.048843734, -0.0012457733, -0.048843734, 0.00077119295, 0.43111858, -0.0013644183, 0.4852841, 0.0008305155, -0.048843734, -0.0014237409, 0.49008754, 0.00088983803, -0.14474064},
{-0.0011271281, -0.14474064, 0.0006525479, -0.048843734, -0.0011864507, 0.050823864, 0.00071187044, -0.048843734, -0.0012457733, 0.2318443, 0.00077119295, 0.43111858, -0.0013644183, 0.4852841, 0.0008305155, -0.048843734, -0.0014237409, 0.49008754, 0.00088983803, -0.14474064},
{-0.0010678057, 0.050823864, 0.00059322536, -0.14474064, -0.0011271281, -0.14474064, 0.0006525479, -0.048843734, -0.0012457733, 0.2318443, 0.00071187044, -0.048843734, -0.0013644183, 0.4852841, 0.00077119295, 0.43111858, -0.0014237409, 0.49008754, 0.0008305155, -0.048843734},
{-0.0011271281, -0.14474064, 0.00059322536, 0.4997265, -0.0012457733, 0.2318443, 0.0006525479, -0.048843734, -0.0013050959, -0.048843734, 0.00071187044, -0.048843734, -0.0013644183, 0.4852841, 0.00077119295, 0.35863516, -0.0014237409, 0.49008754, 0.0008305155, -0.048843734},
{-0.0011271281, -0.14474064, 0.00059322536, 0.49959207, -0.0012457733, 0.2318443, 0.0006525479, 0.1465709, -0.0013050959, -0.048843734, 0.00071187044, -0.14474064, -0.0013644183, 0.4852841, 0.00077119295, 0.35863516, -0.0014237409, 0.49008754, 0.0008305155, -0.048843734},
{-0.0012457733, 0.2318443, 0.00053390284, -0.14474064, -0.0013050959, -0.048843734, 0.00059322536, 0.49959207, -0.0013644183, 0.4852841, 0.0006525479, 0.050823864, -0.0014237409, 0.49008754, 0.00071187044, -0.14474064, -0.0014830634, 0.5, 0.00077119295, 0.35863516},
{-0.0012457733, 0.2318443, 0.00053390284, -0.14474064, -0.0013050959, -0.048843734, 0.00059322536, 0.49959207, -0.0013644183, 0.47820416, 0.0006525479, 0.050823864, -0.0014237409, 0.4852841, 0.00071187044, -0.14474064, -0.0014830634, 0.5, 0.00077119295, 0.35863516},
{-0.0012457733, 0.1465709, 0.00053390284, -0.14474064, -0.0013050959, -0.048843734, 0.00059322536, 0.49959207, -0.0013644183, 0.47820416, 0.0006525479, 0.050823864, -0.0014237409, 0.4852841, 0.00071187044, -0.14474064, -0.0014830634, 0.5, 0.00077119295, 0.35863516},
{-0.0012457733, 0.1465709, 0.00059322536, 0.49959207, -0.0013050959, -0.048843734, 0.0006525479, 0.050823864, -0.0013644183, 0.47820416, 0.00071187044, -0.14474064, -0.0014237409, 0.4527545, 0.00077119295, 0.35863516, -0.0014830634, 0.5, 0.0008305155, -0.048843734},
{-0.0013644183, 0.4852841, 0.00059322536, 0.4997265, -0.0014237409, 0.4527545, 0.0006525479, 0.050823864, -0.0014830634, 0.5, 0.00071187044, -0.14474064, -0.0015423859, 0.49939156, 0.00077119295, 0.35863516, -0.0016017085, 0.499995, 0.0008305155, -0.048843734},
{-0.0013050959, -0.14474064, 0.00059322536, 0.49959207, -0.0013644183, 0.4852841, 0.0006525479, 0.050823864, -0.0014237409, 0.4527545, 0.00077119295, 0.35863516, -0.0014830634, 0.5, 0.0008305155, -0.048843734, -0.0015423859, 0.49939156, 0.00088983803, -0.14474064},
{-0.0013050959, -0.14474064, 0.00053390284, -0.14474064, -0.0013644183, 0.4852841, 0.00059322536, 0.49939156, -0.0014237409, 0.4527545, 0.0006525479, 0.050823864, -0.0014830634, 0.5, 0.00077119295, 0.35863516, -0.0015423859, 0.49939156, 0.0008305155, -0.048843734},
{-0.0013050959, -0.14474064, 0.00059322536, 0.49959207, -0.0013644183, 0.4852841, 0.0006525479, 0.050823864, -0.0014237409, 0.4527545, 0.00077119295, 0.35863516, -0.0014830634, 0.5, 0.0008305155, -0.048843734, -0.0015423859, 0.4955216, 0.00088983803, -0.14474064},
{-0.0011864507, -0.14474064, 0.00059322536, 0.49909258, -0.0013050959, -0.14474064, 0.0006525479, 0.050823864, -0.0013644183, 0.4852841, 0.00077119295, 0.35863516, -0.0014237409, 0.46782932, 0.0008305155, -0.14474064, -0.0014830634, 0.5, 0.00088983803, -0.14474064},
{0.00017796761, -0.048843734, 0.00059322536, 0.49909258, -0.0010084831, -0.14474064, 0.0006525479, 0.050823864, -0.0011864507, -0.14474064, 0.00077119295, 0.35863516, -0.0013050959, -0.048843734, 0.0008305155, -0.14474064, -0.0013644183, 0.4852841, 0.00088983803, -0.14474064},
{-0.0010084831, -0.14474064, 0.00017796761, -0.048843734, -0.0011864507, -0.14474064, 0.00059322536, 0.49909258, -0.0013050959, 0.050823864, 0.0006525479, 0.050823864, -0.0013644183, 0.4852841, 0.00077119295, 0.35863516, -0.0014237409, 0.46782932, 0.0008305155, -0.14474064},
{-0.0011864507, -0.14474064, 0.00017796761, -0.048843734, -0.0013050959, 0.050823864, 0.00059322536, 0.4986469, -0.0013644183, 0.4852841, 0.0006525479, 0.050823864, -0.0014237409, 0.46782932, 0.00077119295, 0.35863516, -0.0014830634, 0.5, 0.0008305155, -0.14474064},
{-0.0011864507, -0.14474064, 0.00017796761, -0.048843734, -0.0013050959, 0.050823864, 0.00059322536, 0.4986469, -0.0013644183, 0.4852841, 0.0006525479, 0.050823864, -0.0014237409, 0.46782932, 0.00077119295, 0.35863516, -0.0014830634, 0.5, 0.0008305155, -0.14474064},
{-0.0012457733, -0.14474064, 0.000118645075, -0.14474064, -0.0013050959, 0.050823864, 0.00017796761, 0.050823864, -0.0013644183, 0.4852841, 0.00059322536, 0.49798274, -0.0014237409, 0.46782932, 0.0006525479, -0.14474064, -0.0014830634, 0.5, 0.00077119295, 0.35863516},
{-0.0011864507, 0.46782932, -0.0004745803, -0.14474064, -0.0012457733, -0.14474064, 0.000118645075, -0.14474064, -0.0013050959, 0.050823864, 0.00017796761, -0.048843734, -0.0013644183, 0.4852841, 0.00053390284, -0.14474064, -0.0014237409, 0.46782932, 0.00059322536, 0.49798274},
{-0.0012457733, -0.048843734, -0.0004745803, -0.14474064, -0.0013050959, -0.14474064, 0.000118645075, -0.14474064, -0.0013644183, 0.4852841, 0.00017796761, -0.14474064, -0.0014237409, 0.4955216, 0.00053390284, -0.14474064, -0.0014830634, 0.5, 0.00059322536, 0.49909258},
{-0.0011271281, 0.1465709, 0.000118645075, -0.14474064, -0.0011864507, -0.14474064, 0.00017796761, -0.14474064, -0.0012457733, -0.048843734, 0.00053390284, -0.14474064, -0.0013050959, -0.14474064, 0.00059322536, 0.49909258, -0.0013644183, 0.4852841, 0.0006525479, -0.14474064},
{-0.0004745803, 0.49798274, 0.000118645075, -0.048843734, -0.0011271281, 0.1465709, 0.00017796761, -0.14474064, -0.0011864507, -0.14474064, 0.00053390284, -0.14474064, -0.0012457733, -0.048843734, 0.00059322536, 0.49909258, -0.0013050959, -0.14474064, 0.0006525479, -0.14474064},
{0.000118645075, 0.30281785, 0.00017796761, -0.14474064, -0.0004745803, 0.49909258, 0.00053390284, -0.14474064, -0.0008305155, 0.4527545, 0.00059322536, 0.49909258, -0.0011271281, 0.1465709, 0.0006525479, -0.14474064, -0.0012457733, -0.048843734, 0.00077119295, 0.35863516},
{-0.0004745803, 0.49909258, 0.000118645075, -0.048843734, -0.0008305155, 0.4527545, 0.00017796761, -0.14474064, -0.0011271281, 0.1465709, 0.00053390284, -0.14474064, -0.0011864507, -0.14474064, 0.00059322536, 0.49909258, -0.0012457733, -0.048843734, 0.0006525479, -0.14474064},
{-0.0004745803, 0.49909258, 0.000118645075, 0.1465709, -0.0008305155, 0.4527545, 0.00053390284, -0.14474064, -0.0011271281, 0.1465709, 0.00059322536, 0.49909258, -0.0012457733, 0.30281785, 0.00077119295, 0.35863516, -0.0013050959, -0.14474064, 0.0008305155, -0.14474064},
{-0.0004745803, 0.49909258, 0.000118645075, 0.49008754, -0.0008305155, 0.4527545, 0.00053390284, -0.14474064, -0.0011271281, 0.1465709, 0.00059322536, 0.49909258, -0.0012457733, 0.30281785, 0.00077119295, 0.35863516, -0.0013050959, -0.14474064, 0.0008305155, -0.14474064},
{-0.0004745803, 0.49909258, 0.000118645075, 0.4852841, -0.0008305155, 0.4527545, 0.00053390284, -0.14474064, -0.0011271281, 0.1465709, 0.00059322536, 0.49909258, -0.0012457733, 0.30281785, 0.00077119295, 0.35863516, -0.0013050959, -0.14474064, 0.0008305155, -0.14474064},
{-0.0004745803, 0.49909258, 0.000118645075, 0.4527545, -0.0008305155, 0.4527545, 0.00053390284, -0.14474064, -0.0011271281, 0.1465709, 0.00059322536, 0.49909258, -0.0012457733, 0.30281785, 0.00077119295, 0.35863516, -0.0013050959, -0.14474064, 0.0008305155, -0.14474064},
{-0.0004745803, 0.49909258, 0.000118645075, -0.14474064, -0.0008305155, 0.4527545, 0.00053390284, -0.14474064, -0.0010084831, -0.14474064, 0.00059322536, 0.49909258, -0.0011271281, 0.1465709, 0.00077119295, 0.35863516, -0.0012457733, 0.30281785, 0.0008305155, -0.14474064},
{0.00041525776, 0.1465709, 0.00053390284, -0.14474064, -0.0004745803, 0.49909258, 0.00059322536, 0.49909258, -0.0008305155, 0.4527545, 0.00077119295, 0.35863516, -0.0010084831, -0.14474064, 0.0008305155, -0.14474064, -0.0011271281, 0.1465709, 0.00088983803, -0.14474064},
{0.000118645075, -0.14474064, 0.00053390284, -0.14474064, -0.0004745803, 0.43111858, 0.00059322536, 0.49939156, -0.0008305155, 0.4527545, 0.00077119295, -0.048843734, -0.0010084831, -0.14474064, 0.0008305155, -0.14474064, -0.0011271281, 0.2318443, 0.00088983803, -0.14474064},
{0.000118645075, -0.048843734, 0.0004745803, -0.14474064, -0.0004745803, 0.40060815, 0.00059322536, 0.49939156, -0.0008305155, 0.4527545, 0.00077119295, -0.048843734, -0.0010084831, -0.14474064, 0.0008305155, -0.14474064, -0.0011271281, 0.2318443, 0.00088983803, -0.14474064},
{-0.0004745803, 0.43111858, -0.00017796761, -0.14474064, -0.0008305155, 0.4527545, 0.0004745803, 0.050823864, -0.0010084831, -0.14474064, 0.00059322536, 0.49939156, -0.0011271281, 0.2318443, 0.00077119295, -0.048843734, -0.0012457733, 0.30281785, 0.0008305155, -0.14474064},
{-0.0004745803, 0.43111858, -0.00017796761, 0.30281785, -0.0008305155, 0.4527545, 0.0004745803, 0.1465709, -0.0010084831, -0.14474064, 0.00059322536, 0.49939156, -0.0011271281, 0.2318443, 0.00077119295, -0.048843734, -0.0012457733, 0.30281785, 0.0008305155, -0.14474064},
{-0.0004745803, 0.43111858, -0.000118645075, -0.14474064, -0.0008305155, 0.4527545, 0.0004745803, 0.1465709, -0.0010084831, -0.14474064, 0.00059322536, 0.49909258, -0.0011271281, 0.2318443, 0.00077119295, -0.048843734, -0.0012457733, 0.30281785, 0.0008305155, -0.14474064},
{-0.000118645075, -0.14474064, 0.00059322536, 0.49909258, -0.00017796761, -0.14474064, 0.00077119295, -0.048843734, -0.0004745803, 0.43111858, 0.0008305155, -0.14474064, -0.0008305155, 0.4527545, 0.00088983803, -0.14474064, -0.0010084831, -0.14474064, 0.0010084831, -0.048843734},
{-0.00017796761, -0.14474064, 0.00059322536, 0.4997265, -0.00041525776, -0.14474064, 0.00077119295, -0.048843734, -0.0004745803, 0.4527545, 0.0008305155, -0.14474064, -0.0010084831, -0.14474064, 0.00088983803, -0.14474064, -0.0011271281, -0.14474064, 0.0010084831, -0.048843734},
{-0.000118645075, -0.14474064, 0.00059322536, 0.49939156, -0.00017796761, -0.14474064, 0.00077119295, -0.048843734, -0.00041525776, -0.14474064, 0.0008305155, -0.14474064, -0.0004745803, 0.4527545, 0.00088983803, -0.14474064, -0.0010084831, -0.14474064, 0.0010084831, -0.048843734},
{-0.000118645075, -0.14474064, 0.00053390284, -0.14474064, -0.00017796761, -0.14474064, 0.00059322536, 0.49798274, -0.00041525776, -0.14474064, 0.00077119295, -0.048843734, -0.0004745803, 0.4527545, 0.0008305155, -0.14474064, -0.0010084831, -0.14474064, 0.00088983803, -0.14474064},
{-0.000118645075, -0.14474064, 0.00059322536, 0.49798274, -0.00017796761, -0.14474064, 0.00077119295, -0.048843734, -0.00041525776, -0.14474064, 0.0008305155, -0.14474064, -0.0004745803, 0.4527545, 0.00088983803, -0.14474064, -0.0010084831, -0.14474064, 0.0010084831, -0.048843734},
{0.00053390284, 0.050823864, 0.00059322536, 0.49798274, -0.000118645075, -0.14474064, 0.00077119295, -0.048843734, -0.00017796761, -0.14474064, 0.0008305155, -0.14474064, -0.00041525776, -0.14474064, 0.00088983803, -0.14474064, -0.0004745803, 0.4527545, 0.0010084831, -0.048843734},
{-0.000118645075, -0.14474064, 0.00035593522, -0.14474064, -0.00017796761, -0.14474064, 0.00059322536, 0.49798274, -0.00041525776, -0.14474064, 0.00077119295, -0.048843734, -0.0004745803, 0.4527545, 0.0008305155, -0.14474064, -0.0010084831, -0.14474064, 0.00088983803, -0.14474064},
{-0.000118645075, -0.14474064, 0.00053390284, -0.14474064, -0.00017796761, -0.14474064, 0.00059322536, 0.49798274, -0.00041525776, -0.14474064, 0.00077119295, -0.048843734, -0.0004745803, 0.4527545, 0.0008305155, -0.14474064, -0.0010084831, -0.14474064, 0.00088983803, -0.14474064},
{-0.000118645075, 0.46782932, 0.00053390284, -0.14474064, -0.00017796761, -0.14474064, 0.00059322536, 0.49798274, -0.00041525776, -0.14474064, 0.00077119295, -0.048843734, -0.0004745803, 0.4527545, 0.0008305155, -0.14474064, -0.0010084831, -0.14474064, 0.00088983803, -0.14474064},
{-0.000118645075, 0.46782932, 0.00059322536, 0.49798274, -0.00017796761, -0.14474064, 0.00077119295, -0.048843734, -0.00041525776, -0.14474064, 0.0008305155, -0.14474064, -0.0004745803, 0.4527545, 0.00088983803, -0.14474064, -0.0010084831, -0.14474064, 0.0010084831, -0.048843734},
{0.00023729015, 0.050823864, 0.0004745803, -0.14474064, -5.9322538e-05, -0.048843734, 0.00053390284, 0.43111858, -0.000118645075, 0.46782932, 0.00059322536, 0.4955216, -0.00017796761, -0.14474064, 0.00077119295, -0.048843734, -0.00041525776, -0.14474064, 0.0008305155, -0.14474064},
{0.00023729015, -0.048843734, 0.0004745803, 0.35863516, -5.9322538e-05, -0.048843734, 0.00053390284, 0.43111858, -0.000118645075, 0.4527545, 0.00059322536, 0.4955216, -0.00017796761, -0.14474064, 0.00077119295, -0.048843734, -0.00041525776, -0.14474064, 0.0008305155, -0.14474064},
{-5.9322538e-05, -0.048843734, 0.00023729015, -0.048843734, -0.000118645075, 0.4527545, 0.0004745803, 0.35863516, -0.00017796761, -0.14474064, 0.00053390284, 0.43111858, -0.00041525776, -0.14474064, 0.00059322536, 0.4955216, -0.0004745803, 0.4527545, 0.00077119295, -0.048843734},
{-0.000118645075, 0.4527545, -5.9322538e-05, -0.048843734, -0.00017796761, -0.14474064, 0.00023729015, -0.14474064, -0.00041525776, -0.14474064, 0.0004745803, 0.35863516, -0.0004745803, 0.4527545, 0.00053390284, 0.46782932, -0.0010084831, -0.14474064, 0.00059322536, 0.4955216},
{-0.00017796761, -0.14474064, -0.000118645075, -0.14474064, -0.00041525776, -0.14474064, 0.0004745803, 0.30281785, -0.0004745803, 0.050823864, 0.00053390284, 0.46782932, -0.0010084831, -0.14474064, 0.00059322536, 0.4955216, -0.0011271281, -0.14474064, 0.00077119295, -0.048843734},
{-0.00041525776, -0.14474064, -0.00017796761, -0.14474064, -0.0004745803, 0.050823864, 0.0004745803, 0.30281785, -0.0010084831, -0.14474064, 0.00053390284, 0.46782932, -0.0011271281, -0.14474064, 0.00059322536, 0.4955216, -0.0012457733, 0.1465709, 0.00077119295, -0.048843734},
{-0.00041525776, -0.14474064, -0.00017796761, 0.050823864, -0.0004745803, 0.050823864, 0.0004745803, 0.35863516, -0.0010084831, -0.14474064, 0.00053390284, 0.46782932, -0.0011271281, -0.14474064, 0.00059322536, 0.4955216, -0.0012457733, 0.1465709, 0.00077119295, -0.048843734},
{-5.9322538e-05, -0.21829097, 0.0004745803, 0.35863516, -0.00041525776, -0.14474064, 0.00053390284, 0.46782932, -0.0004745803, -0.048843734, 0.00059322536, 0.4955216, -0.00053390284, -0.14474064, 0.00077119295, -0.048843734, -0.0010084831, -0.14474064, 0.0008305155, -0.14474064},
{-0.00041525776, -0.14474064, -5.9322538e-05, 0.42716938, -0.0004745803, -0.14474064, 0.00041525776, -0.14474064, -0.00053390284, -0.14474064, 0.0004745803, 0.4527545, -0.0010084831, -0.14474064, 0.00053390284, 0.47820416, -0.0011271281, -0.14474064, 0.00059322536, 0.4969936},
{-0.00017796761, -0.14474064, -5.9322538e-05, 0.42716938, -0.00041525776, -0.14474064, 0.00041525776, -0.14474064, -0.0004745803, -0.14474064, 0.0004745803, 0.4527545, -0.00053390284, -0.14474064, 0.00053390284, 0.47820416, -0.0010084831, -0.14474064, 0.00059322536, 0.4969936},
{-0.00035593522, -0.14474064, -5.9322538e-05, 0.39510676, -0.00041525776, -0.22710821, 0.00041525776, -0.14474064, -0.0004745803, -0.14474064, 0.0004745803, 0.4527545, -0.00053390284, -0.14474064, 0.00053390284, 0.47820416, -0.0010084831, -0.14474064, 0.00059322536, 0.4969936},
{-0.0004745803, -0.22710821, -5.9322538e-05, 0.39510676, -0.00053390284, -0.14474064, 0.00041525776, -0.14474064, -0.0010084831, -0.14474064, 0.0004745803, 0.4527545, -0.0011271281, -0.14474064, 0.00053390284, 0.4527545, -0.0012457733, 0.1465709, 0.00059322536, 0.4969936},
{-0.0010084831, -0.14474064, -0.0004745803, -0.16641168, -0.0011271281, -0.14474064, -5.9322538e-05, 0.39510676, -0.0012457733, 0.1465709, 0.00041525776, -0.14474064, -0.0013050959, 0.4527545, 0.0004745803, 0.4527545, -0.0013644183, 0.4852841, 0.00053390284, 0.4527545},
{-0.00041525776, 0.16818777, 0.00041525776, -0.048843734, -0.0010084831, -0.14474064, 0.0004745803, 0.4527545, -0.0011271281, -0.14474064, 0.00053390284, 0.4527545, -0.0012457733, 0.1465709, 0.00059322536, 0.4969936, -0.0013050959, 0.4527545, 0.00077119295, -0.048843734},
{-0.0010084831, -0.14474064, -0.0004745803, -0.14474064, -0.0011271281, -0.14474064, -0.00041525776, 0.12433751, -0.0012457733, 0.1465709, 0.00041525776, -0.048843734, -0.0013050959, 0.4527545, 0.0004745803, 0.4527545, -0.0013644183, 0.4852841, 0.00053390284, 0.4527545},
{-0.0010084831, -0.14474064, -0.0004745803, -0.14474064, -0.0011271281, -0.14474064, -0.00041525776, -0.048843734, -0.0012457733, 0.1465709, 0.00041525776, -0.048843734, -0.0013050959, 0.4527545, 0.0004745803, 0.4527545, -0.0013644183, 0.4852841, 0.00053390284, 0.4527545},
{-0.0010084831, 0.49008754, -0.00041525776, -0.048843734, -0.0011271281, -0.14474064, 0.00041525776, -0.048843734, -0.0012457733, 0.1465709, 0.0004745803, 0.4527545, -0.0013050959, 0.4527545, 0.00053390284, 0.4527545, -0.0013644183, 0.4852841, 0.00059322536, 0.4969936},
{-0.00041525776, 0.050823864, 0.00041525776, -0.048843734, -0.0010084831, 0.49464312, 0.0004745803, 0.46782932, -0.0011271281, -0.14474064, 0.00053390284, 0.4527545, -0.0012457733, 0.1465709, 0.00059322536, 0.4969936, -0.0013050959, 0.4527545, 0.00077119295, -0.048843734}
};

int row = tmp_data.size();
int col = tmp_data[0].size();
std::vector input_shape1 = {1, row, col};
std::vector input_data1(row * col);

for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
// LOG(INFO) << "i:" << i << ", j:" << j;
input_data1[i * j + j] = tmp_data[i][j];
}
}
std::vector out_data;
runTwo(predictor.get(), input_data0, input_shape0, input_data1, input_shape0, &out_data);

LOG(INFO) << "size: " << out_data.size();
for (size_t i = 0; i < out_data.size(); i += 100) {
LOG(INFO) << i << " : " << out_data[i] << std::endl;
}
return 0;
}

wn9m85ua

wn9m85ua1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看 官网API文档常见问题历史IssueAI社区 来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

qacovj5a

qacovj5a2#

看报错是输入tensor和定义的 shape / axis 尺寸不符,分别是 3 和 4。请根据更多的报错信息定位到对应的代码行检查输入的尺寸。

tcomlyy6

tcomlyy63#

请问paddle inreference 中的reshape函数的输入只是具体的维度信息吗?比如一维就是{39}, 二维就是{100, 20},还是需要增加比如batch_size,channel这样的信息?

gdrx4gfi

gdrx4gfi4#

看报错是输入tensor和定义的 shape / axis 尺寸不符,分别是 3 和 4。请根据更多的报错信息定位到对应的代码行检查输入的尺寸。

请问有引用paddleinferrence的.cmake文件吗

相关问题