lxtGH/SFSegNets

Does anybody successfully convert this model to TensorRT?

dlz620301 opened this issue · 5 comments

Give the custom version of "torch.nn.functional.grid_sample", "torch.nn.AdaptiveAvgPool2d", "torch.linspace"... But still failed to convert onnx to tensorrt.

Due to onnx not support dynamic parameter as follow, you can set the size to constant by computing
image
Can you provide the workarounds for operator are not support mentioned above? Thanks

Due to onnx not support dynamic parameter as follow, you can set the size to constant by computing image Can you provide the workarounds for operator are not support mentioned above? Thanks

My environment is tensorrt 7.0.0.11,pytorch 1.8.0+cu111. When setting opset_version=10, the convert error will be like:
ModelImporter.cpp:129: Resize_95 [Resize] inputs: [2378 -> (1, 128, -1, -1)], [424 -> (4)], While parsing node number 95 [Resize]: ERROR: builtin_op_importers.cpp:2412 In function importResize: [8] Assertion failed: scales.is_weights() && "Resize scales must be an initializer!" parse model failed Aborted (core dumped)
and opset_version=11 comes like:
ModelImporter.cpp:129: Pad_20 [Pad] inputs: [314 -> (1, 128, -1, -1)], [326 -> (8)], terminate called after throwing an instance of 'std::out_of_range' what(): Attribute not found: pads Aborted (core dumped)

Due to onnx not support dynamic parameter as follow, you can set the size to constant by computing image Can you provide the workarounds for operator are not support mentioned above? Thanks

My environment is tensorrt 7.0.0.11,pytorch 1.8.0+cu111. When setting opset_version=10, the convert error will be like: ModelImporter.cpp:129: Resize_95 [Resize] inputs: [2378 -> (1, 128, -1, -1)], [424 -> (4)], While parsing node number 95 [Resize]: ERROR: builtin_op_importers.cpp:2412 In function importResize: [8] Assertion failed: scales.is_weights() && "Resize scales must be an initializer!" parse model failed Aborted (core dumped) and opset_version=11 comes like: ModelImporter.cpp:129: Pad_20 [Pad] inputs: [314 -> (1, 128, -1, -1)], [326 -> (8)], terminate called after throwing an instance of 'std::out_of_range' what(): Attribute not found: pads Aborted (core dumped)

Sorry i haven't meet similar issue.
My environment as follow:
1、Tensorrt version: 8.4.1.5
2、Pytorch version: 1.8.0
3、Cuda version: 11.1
4、opset_version:11
not use resize op
May be still dynamic parameters issue. Thanks

Due to onnx not support dynamic parameter as follow, you can set the size to constant by computing image Can you provide the workarounds for operator are not support mentioned above? Thanks

My environment is tensorrt 7.0.0.11,pytorch 1.8.0+cu111. When setting opset_version=10, the convert error will be like: ModelImporter.cpp:129: Resize_95 [Resize] inputs: [2378 -> (1, 128, -1, -1)], [424 -> (4)], While parsing node number 95 [Resize]: ERROR: builtin_op_importers.cpp:2412 In function importResize: [8] Assertion failed: scales.is_weights() && "Resize scales must be an initializer!" parse model failed Aborted (core dumped) and opset_version=11 comes like: ModelImporter.cpp:129: Pad_20 [Pad] inputs: [314 -> (1, 128, -1, -1)], [326 -> (8)], terminate called after throwing an instance of 'std::out_of_range' what(): Attribute not found: pads Aborted (core dumped)

Sorry i haven't meet similar issue. My environment as follow: 1、Tensorrt version: 8.4.1.5 2、Pytorch version: 1.8.0 3、Cuda version: 11.1 4、opset_version:11 not use resize op May be still dynamic parameters issue. Thanks

OK, thanks~☺

Please use the latest pytorch version to convert SF-Net to TensorRT.