[onnx->TensorRT]Parser problem about padding

Hi,

I’m trying to accelerate model inference speed by TensorRT, the model has been first convert to onnx format from tensorflow saved model using tf2onnx .
When I parse the onnx model using tensorrt.OnnxParser(), I got this error:

[TensorRT] VERBOSE: ModelImporter.cpp:103: Parsing node: generator/G_MODEL/A/MirrorPad [Pad]
[TensorRT] VERBOSE: ModelImporter.cpp:119: Searching for input: generator_input:0
[TensorRT] VERBOSE: ModelImporter.cpp:119: Searching for input: const_fold_opt__1670
[TensorRT] VERBOSE: ModelImporter.cpp:125: generator/G_MODEL/A/MirrorPad [Pad] inputs: [generator_input:0 -> (1, -1, -1, 3)], [const_fold_opt__1670 -> (8)], 
ERROR: Failed to parse the ONNX file.
number of errors: 1
In node -1 (importPad): UNSUPPORTED_NODE: Assertion failed: mode == "constant" && value == 0.f && "This version of TensorRT only supports constant 0 padding!"

I read some related issues posted by others, It seems like TensorRT can only support constant 0 padding, but in my model, the pad in reflect mode. In this case, what can I do to solve this problem?

Deepest thanks for your reply!

Environment

TensorRT Version: 7.2.3.4
GPU Type: GTX 1080
Nvidia Driver Version: 450.51.06
CUDA Version: 10.0
CUDNN Version: 7.6.4
Operating System + Version: Ubuntu 16.04
Python Version (if applicable): 3.7.10
TensorFlow Version (if applicable): tensorflow-gpu 1.15.0
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Hi,
Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:

  1. validating your model with the below snippet

check_model.py

import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
onnx.checker.check_model(model).
2) Try running your model with trtexec command.

In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!

Thanks for you prompt reply!

  1. I run the check_model.py with my onnx model, it has no warning or errors.
  2. I build the trtexec and try running my model with trtexec command:
&&&& RUNNING TensorRT.trtexec # /home/lulin/TensorRT/TensorRT-7.2.3.4/bin/trtexec --onnx=hayao_op11.onnx --verbose
[04/19/2021-11:32:29] [I] === Model Options ===
[04/19/2021-11:32:29] [I] Format: ONNX
[04/19/2021-11:32:29] [I] Model: hayao_op11.onnx
[04/19/2021-11:32:29] [I] Output:
[04/19/2021-11:32:29] [I] === Build Options ===
[04/19/2021-11:32:29] [I] Max batch: explicit
[04/19/2021-11:32:29] [I] Workspace: 16 MiB
[04/19/2021-11:32:29] [I] minTiming: 1
[04/19/2021-11:32:29] [I] avgTiming: 8
[04/19/2021-11:32:29] [I] Precision: FP32
[04/19/2021-11:32:29] [I] Calibration: 
[04/19/2021-11:32:29] [I] Refit: Disabled
[04/19/2021-11:32:29] [I] Safe mode: Disabled
[04/19/2021-11:32:29] [I] Save engine: 
[04/19/2021-11:32:29] [I] Load engine: 
[04/19/2021-11:32:29] [I] Builder Cache: Enabled
[04/19/2021-11:32:29] [I] NVTX verbosity: 0
[04/19/2021-11:32:29] [I] Tactic sources: Using default tactic sources
[04/19/2021-11:32:29] [I] Input(s)s format: fp32:CHW
[04/19/2021-11:32:29] [I] Output(s)s format: fp32:CHW
[04/19/2021-11:32:29] [I] Input build shapes: model
[04/19/2021-11:32:29] [I] Input calibration shapes: model
[04/19/2021-11:32:29] [I] === System Options ===
[04/19/2021-11:32:29] [I] Device: 0
[04/19/2021-11:32:29] [I] DLACore: 
[04/19/2021-11:32:29] [I] Plugins:
[04/19/2021-11:32:29] [I] === Inference Options ===
[04/19/2021-11:32:29] [I] Batch: Explicit
[04/19/2021-11:32:29] [I] Input inference shapes: model
[04/19/2021-11:32:29] [I] Iterations: 10
[04/19/2021-11:32:29] [I] Duration: 3s (+ 200ms warm up)
[04/19/2021-11:32:29] [I] Sleep time: 0ms
[04/19/2021-11:32:29] [I] Streams: 1
[04/19/2021-11:32:29] [I] ExposeDMA: Disabled
[04/19/2021-11:32:29] [I] Data transfers: Enabled
[04/19/2021-11:32:29] [I] Spin-wait: Disabled
[04/19/2021-11:32:29] [I] Multithreading: Disabled
[04/19/2021-11:32:29] [I] CUDA Graph: Disabled
[04/19/2021-11:32:29] [I] Separate profiling: Disabled
[04/19/2021-11:32:29] [I] Skip inference: Disabled
[04/19/2021-11:32:29] [I] Inputs:
[04/19/2021-11:32:29] [I] === Reporting Options ===
[04/19/2021-11:32:29] [I] Verbose: Enabled
[04/19/2021-11:32:29] [I] Averages: 10 inferences
[04/19/2021-11:32:29] [I] Percentile: 99
[04/19/2021-11:32:29] [I] Dump refittable layers:Disabled
[04/19/2021-11:32:29] [I] Dump output: Disabled
[04/19/2021-11:32:29] [I] Profile: Disabled
[04/19/2021-11:32:29] [I] Export timing to JSON file: 
[04/19/2021-11:32:29] [I] Export output to JSON file: 
[04/19/2021-11:32:29] [I] Export profile to JSON file: 
[04/19/2021-11:32:29] [I] 
[04/19/2021-11:32:29] [I] === Device Information ===
[04/19/2021-11:32:29] [I] Selected Device: GeForce GTX 1080
[04/19/2021-11:32:29] [I] Compute Capability: 6.1
[04/19/2021-11:32:29] [I] SMs: 20
[04/19/2021-11:32:29] [I] Compute Clock Rate: 1.873 GHz
[04/19/2021-11:32:29] [I] Device Global Memory: 8116 MiB
[04/19/2021-11:32:29] [I] Shared Memory per SM: 96 KiB
[04/19/2021-11:32:29] [I] Memory Bus Width: 256 bits (ECC disabled)
[04/19/2021-11:32:29] [I] Memory Clock Rate: 5.005 GHz
[04/19/2021-11:32:29] [I] 
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::GridAnchor_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::NMS_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::Reorg_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::Region_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::Clip_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::LReLU_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::PriorBox_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::Normalize_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::RPROI_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::BatchedNMS_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::BatchedNMSDynamic_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::FlattenConcat_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::CropAndResize version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::DetectionLayer_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::Proposal version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::ProposalLayer_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::PyramidROIAlign_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::ResizeNearest_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::Split version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::SpecialSlice_TRT version 1
[04/19/2021-11:32:29] [V] [TRT] Registered plugin creator - ::InstanceNormalization_TRT version 1
----------------------------------------------------------------
Input filename:   hayao_op11.onnx
ONNX IR version:  0.0.6
Opset version:    11
Producer name:    tf2onnx
Producer version: 1.8.4
Domain:           
Model version:    0
Doc string:       
----------------------------------------------------------------
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::GridAnchor_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::NMS_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::Reorg_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::Region_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::Clip_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::LReLU_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::PriorBox_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::Normalize_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::RPROI_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::BatchedNMS_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::BatchedNMSDynamic_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::FlattenConcat_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::CropAndResize version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::DetectionLayer_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::Proposal version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::ProposalLayer_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::PyramidROIAlign_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::ResizeNearest_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::Split version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::SpecialSlice_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] Plugin creator already registered - ::InstanceNormalization_TRT version 1
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:202: Adding network input: generator_input:0 with dtype: float32, dimensions: (1, -1, -1, 3)
[04/19/2021-11:32:30] [V] [TRT] ImporterContext.hpp:120: Registering tensor: generator_input:0 for ONNX tensor: generator_input:0
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/out_layer/Conv/weights/read__84
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/E/LayerNorm_2/gamma/read__83
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/E/LayerNorm_1/gamma/read__80
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/E/LayerNorm/gamma/read__77
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/E/Conv_2/weights/read__81
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/E/Conv_1/weights/read__78
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/E/Conv/weights/read__75
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/D/mul/x:0
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/D/LayerNorm_1/gamma/read__74
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/D/LayerNorm/gamma/read__71
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/D/Conv_1/weights/read__72
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/D/Conv/weights/read__69
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r4/r4/bias/read__60
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r4/LayerNorm/gamma/read__58
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r4/Conv_1/weights/read__63
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r4/Conv/weights/read__56
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r4/2/gamma/read__65
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r4/1/gamma/read__62
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r3/r3/bias/read__50
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r3/LayerNorm/gamma/read__48
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r3/Conv_1/weights/read__53
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r3/Conv/weights/read__46
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r3/2/gamma/read__55
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r3/1/gamma/read__52
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r2/r2/bias/read__40
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r2/LayerNorm/gamma/read__38
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r2/Conv_1/weights/read__43
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r2/Conv/weights/read__36
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r2/2/gamma/read__45
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r2/1/gamma/read__42
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r1/r1/bias/read__30
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r1/LayerNorm/gamma/read__28
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r1/Conv_1/weights/read__33
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r1/Conv/weights/read__26
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r1/2/gamma/read__35
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/r1/1/gamma/read__32
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/LayerNorm_1/gamma/read__68
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/LayerNorm/gamma/read__25
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/Conv_1/weights/read__66
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/C/Conv/weights/read__23
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/B/LayerNorm_1/gamma/read__22
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/B/LayerNorm/gamma/read__19
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/B/Conv_1/weights/read__20
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/B/Conv/weights/read__17
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/A/LayerNorm_2/gamma/read__16
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/A/LayerNorm_1/gamma/read__13
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/A/LayerNorm/gamma/read__10
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/A/Conv_2/weights/read__14
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/A/Conv_1/weights/read__11
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: generator/G_MODEL/A/Conv/weights/read__8
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_two__403
[04/19/2021-11:32:30] [W] [TRT] onnx2trt_utils.cpp:220: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_starts__394
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1670
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1665
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1664
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1663
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1661
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1655
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1653
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1652
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1651
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1649
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1646
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1645
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1644
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1643
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1641
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1638
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1637
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1635
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1634
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1632
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1627
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1626
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1621
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1600
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1590
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1588
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1587
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1584
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1565
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1564
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1561
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_fold_opt__1557
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_ends__333
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_empty_float__347
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: const_axes__334
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:90: Importing initializer: Const__1482
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:103: Parsing node: generator/G_MODEL/A/MirrorPad [Pad]
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:119: Searching for input: generator_input:0
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:119: Searching for input: const_fold_opt__1670
[04/19/2021-11:32:30] [V] [TRT] ModelImporter.cpp:125: generator/G_MODEL/A/MirrorPad [Pad] inputs: [generator_input:0 -> (1, -1, -1, 3)], [const_fold_opt__1670 -> (8)], 
ERROR: builtin_op_importers.cpp:2261 In function importPad:
[8] Assertion failed: mode == "constant" && value == 0.f && "This version of TensorRT only supports constant 0 padding!"
[04/19/2021-11:32:30] [E] Failed to parse onnx file
[04/19/2021-11:32:30] [E] Parsing model failed
[04/19/2021-11:32:30] [E] Engine creation failed
[04/19/2021-11:32:30] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec # /home/lulin/TensorRT/TensorRT-7.2.3.4/bin/trtexec --onnx=hayao_op11.onnx --verbose

I think it still facing the padding mode issue, should I need to add the custom layer?

Thanks!

Hi @lulindeng073,

TRT doesn’t support reflect padding. You may need to re-train the model with zero padding.

Thank you.