Skip to content

onnx2paddle报错TypeError: object of type 'NoneType' has no len() ` #436

Open
@merlinarer

Description

@merlinarer

想把resnest的deepv3转成paddle的,op9的时候上采样层会报错,所以用了op11,但是onnx转paddle的时候就报错了
`TensorRT dynamic library (libnvinfer.so) that Paddle depends on is not configured correctly. (error code is libnvinfer.so: cannot open shared object file: No such file or directory)
Suggestions:

  1. Check if TensorRT is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure TensorRT dynamic library environment variables as follows:
  • Linux: set LD_LIBRARY_PATH by export LD_LIBRARY_PATH=...
  • Windows: set PATH by set PATH=XXX;paddle.__version__ = 1.8.5 Now translating model from onnx to paddle. model ir_version: 6, op version: 11 shape inferencing ... shape inferenced. Now, onnx2paddle support convert onnx model opset_verison [9],opset_verison of your onnx model is 11, automatically treated as op_set: 9. Total nodes: 3547 Nodes converting ... convert failed node:2742, op_type is Pad Traceback (most recent call last): File "/root/miniconda3/bin/x2paddle", line 33, in <module> sys.exit(load_entry_point('x2paddle==0.8.8', 'console_scripts', 'x2paddle')()) File "/root/miniconda3/lib/python3.8/site-packages/x2paddle/convert.py", line 282, in main onnx2paddle(args.model, args.save_dir, params_merge) File "/root/miniconda3/lib/python3.8/site-packages/x2paddle/convert.py", line 171, in onnx2paddle mapper = ONNXOpMapper(model) File "/root/miniconda3/lib/python3.8/site-packages/x2paddle/op_mapper/onnx2paddle/onnx_op_mapper.py", line 42, in __init__ func(node) File "/root/miniconda3/lib/python3.8/site-packages/x2paddle/op_mapper/onnx2paddle/opset9/opset.py", line 73, in run_mapping res = func(*args, **kwargs) File "/root/miniconda3/lib/python3.8/site-packages/x2paddle/op_mapper/onnx2paddle/opset9/opset.py", line 408, in Pad if len(pads) == 4: TypeError: object of type 'NoneType' has no len()
    请问应该怎么处理呢?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions