$ paddle2onnx \
--model_dir /root/paddle \
--model_filename /root/paddle/PaddleClas/ppcls/modeling/architectures/resnet_vd.py \
--params_filename /root/paddle/ResNet50_vd_10w_pretrained.pdparams \
--save_file onnx_file.onnx
Traceback (most recent call last):
File "/root/anaconda3/bin/paddle2onnx", line 8, in <module>
sys.exit(main())
File "/root/anaconda3/lib/python3.8/site-packages/paddle2onnx/command.py", line 136, in main
program2onnx(
File "/root/anaconda3/lib/python3.8/site-packages/paddle2onnx/command.py", line 102, in program2onnx
[program, feed_var_names, fetch_vars] = fluid.io.load_inference_model(
File "<decorator-gen-88>", line 2, in load_inference_model
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/framework.py", line 234, in __impl__
return func(*args, **kwargs)
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/io.py", line 1538, in load_inference_model
program = Program.parse_from_string(program_desc_str)
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/framework.py", line 5080, in parse_from_string
p.desc = core.ProgramDesc(binary_str)
ValueError: (InvalidArgument) Failed to parse program_desc from binary string.
[Hint: Expected desc_.ParseFromString(binary_str) == true, but received desc_.ParseFromString(binary_str):0 != true:1.] (at /paddle/paddle/fluid/framework/program_desc.cc:103)
这个模型 https://github.com/PaddlePaddle/PaddleClas/blob/release/2.1/docs/zh_CN/application/transfer_learning.md 页面里面有个.pdparams文件
根据这个文档 https://github.com/PaddlePaddle/Paddle2ONNX/blob/release/0.6/README_zh.md
两个都试了,都有问题
另一个
得到输出
想请问正确的姿势是什么,想直接取这个模型用