错误信息
Traceback (most recent call last):
File "paddle_infer.py", line 7, in
model = paddle.jit.load(paddle_path)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), kw)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, *kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/framework.py", line 449, in impl
return func(args, kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/api.py", line 1500, in load
return TranslatedLayer._construct(model_path, config)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), kw)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, *kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/framework.py", line 449, in impl
return func(args, kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/translated_layer.py", line 1455, in _construct
programs = _construct_program_holders(model_path, model_filename)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/translated_layer.py", line 842, in _construct_program_holders
_load_program_desc(model_file_path)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/translated_layer.py", line 51, in _load_program_desc
program_desc = core.ProgramDesc(program_desc_str)
ValueError: (InvalidArgument) Failed to parse programdesc from binary string.
[Hint: Expected desc.ParseFromString(binarystr) == true, but received desc.ParseFromString(binary_str):0 != true:1.] (at ../paddle/fluid/framework/program_desc.cc:150)
问题描述
onnx转paddle成功但是转换后模型无法加载
错误信息 Traceback (most recent call last): File "paddle_infer.py", line 7, in
model = paddle.jit.load(paddle_path)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), kw)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, *kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/framework.py", line 449, in impl
return func(args, kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/api.py", line 1500, in load
return TranslatedLayer._construct(model_path, config)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), kw)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, *kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/fluid/framework.py", line 449, in impl
return func(args, kwargs)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/translated_layer.py", line 1455, in _construct
programs = _construct_program_holders(model_path, model_filename)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/translated_layer.py", line 842, in _construct_program_holders
_load_program_desc(model_file_path)
File "/opt/conda/envs/paddle2.5.1_cuda11.2/lib/python3.8/site-packages/paddle/jit/translated_layer.py", line 51, in _load_program_desc
program_desc = core.ProgramDesc(program_desc_str)
ValueError: (InvalidArgument) Failed to parse programdesc from binary string.
[Hint: Expected desc.ParseFromString(binarystr) == true, but received desc.ParseFromString(binary_str):0 != true:1.] (at ../paddle/fluid/framework/program_desc.cc:150)
错误截图
具体信息
转换模型后用处
模型来源 https://huggingface.co/BAAI/bge-reranker-base
应用场景 文本检索
版本信息 PaddlePaddle =>2.5.1 X2Paddle => 1.4.1