Skip to content

paddle推理,报错 #75351

@kido045

Description

@kido045

bug描述 Describe the Bug

配置环境:Ubuntu 22.04
Paddle版本:3.2.0-cpu
报错内容:
W0916 13:15:08.661654 670476 pir_interpreter.cc:2032] Instruction OP id: 0, Ir OP id: 2244, onednn_op.fused_conv2d raises an EnforceNotMet exception common::enforce::EnforceNotMet
terminate called after throwing an instance of 'common::enforce::EnforceNotMet'
what():

Compile Traceback (most recent call last):


C++ Traceback (most recent call last):

0 paddle::AnalysisPredictor::ZeroCopyRun(bool)
1 paddle::framework::NaiveExecutor::RunInterpreterCore(std::vector<std::string, std::allocator<std::string > > const&, bool, bool)
2 paddle::framework::InterpreterCore::Run(std::vector<std::string, std::allocator<std::string > > const&, bool, bool, bool, bool)
3 paddle::framework::PirInterpreter::Run(std::vector<std::string, std::allocator<std::string > > const&, bool, bool, bool, bool)
4 paddle::framework::PirInterpreter::TraceRunImpl()
5 paddle::framework::PirInterpreter::TraceRunInstructionList(std::vector<std::unique_ptr<paddle::framework::InstructionBase, std::default_deletepaddle::framework::InstructionBase >, std::allocator<std::unique_ptr<paddle::framework::InstructionBase, std::default_deletepaddle::framework::InstructionBase > > > const&)
6 paddle::framework::PirInterpreter::RunInstructionBase(paddle::framework::InstructionBase*)
7 paddle::framework::OneDNNPhiKernelInstruction::Run()
8 void phi::KernelImpl<void ()(phi::OneDNNContext const&, phi::DenseTensor const&, phi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const&, std::vector<int, std::allocator > const&, int, std::string const&, std::string const&, std::string const&, bool, bool, phi::DenseTensor), &(void phi::fusion::FusedConv2DKernel<float, phi::OneDNNContext>(phi::OneDNNContext const&, phi::DenseTensor const&, phi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const&, std::vector<int, std::allocator > const&, int, std::string const&, std::string const&, std::string const&, bool, bool, phi::DenseTensor*))>::KernelCallHelper<paddle::optionalphi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const&, std::vector<int, std::allocator > const&, int, std::string const&, std::string const&, std::string const&, bool, bool, phi::DenseTensor*, phi::TypeTag >::Compute<1, 2, 0, 0, phi::OneDNNContext const, phi::DenseTensor const, phi::DenseTensor const>(phi::KernelContext*, phi::OneDNNContext const&, phi::DenseTensor const&, phi::DenseTensor const&)
9 void phi::fusion::FusedConv2DKernel<float, phi::OneDNNContext>(phi::OneDNNContext const&, phi::DenseTensor const&, phi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, paddle::optionalphi::DenseTensor const&, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const&, std::vector<int, std::allocator > const&, int, std::string const&, std::string const&, std::string const&, bool, bool, phi::DenseTensor*)
10 void phi::ConvOnednn<float, phi::OneDNNContext>(phi::OneDNNContext const&, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const
yunzhi 13:19:47
10 void phi::ConvOnednn<float, phi::OneDNNContext>(phi::OneDNNContext const&, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const&, std::vector<int, std::allocator > const&, int, std::string const&, bool, bool, std::string const&, bool, bool, phi::DenseTensor*)
11 phi::ComputeFP32<float, float>(phi::OneDNNContext const&, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, phi::DenseTensor const*, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::string const&, std::vector<int, std::allocator > const&, int, std::string const&, bool, bool, std::string const&, bool, bool, phi::DenseTensor*)::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const
12 float const* phi::DenseTensor::data() const
13 common::enforce::EnforceNotMet::EnforceNotMet(common::ErrorSummary const&, char const*, int)
14 common::enforce::GetCurrentTraceBackStringabi:cxx11


Error Message Summary:

InvalidArgumentError: The type of data we are trying to retrieve (float32) does not match the type of data (int32) currently contained in the container.
[Hint: Expected dtype() == phi::CppTypeToDataType::Type(), but received dtype():7 != phi::CppTypeToDataType::Type():10.] (at /paddle/paddle/phi/core/dense_tensor.cc:160)
[operator < onednn_kernel.phi_kernel > error]
Aborted (core dumped)

问题描述:
模型是从torch框架通过ultralytics转过来的。
Python环境下安装调用paddle-cpu,能正常初始化推理预测结果。源码编译paddle3.2.0-cpu,C++推理库,调用模型初始化时,报以上错误。

其他补充信息 Additional Supplementary Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions