c++ execution raise an engine.cpp (555) - Cuda Error in execute: 4

Hi, i follow the example “sampleUffSSD” to create my plugin, code compilation is ok but have this problem while running the program

ERROR: engine.cpp (555) - Cuda Error in execute: 4
ERROR: engine.cpp (555) - Cuda Error in execute: 4
Aborted (core dumped)

what does that mean ?



Please noticed that there are dependencies between uff parser and TensorRT engine.
So you will need to convert the uff model by the same TensorRT version for inferencing.


Thanks for the answer, i have found the root cause and fix it.

now my program(which is modified from sampleUffSSD) is workable but the result is wrong.

i list what i did and would you please give me some advise of debugging TensorRT that i can try to solve it?

  1. i run py script convert_to_uff to change tf.space_to_depth to my custom plugin name and convert tensorflow pb file to uff file.
  2. i implement space to depth function in cuda code and verify the result is same as tf.space_to_depth(in NCHW format) and modify sampleUffSSD to use my custom space to depth plugin and load uff file.
  3. compile and run with no error but the result is wrong.



Would you help to compare the inference result with TensorFlow to find out the layer error comes from?

@AastaLLL, Thanks for the response.

let me confirm one thing, the data format of TensorRT is NCHW and TensorFlow is NHWC but this will be handled during the model converts to UFF file right ?

and i only need to feed the data(input image) in NCHW format and read Output in NCHW format right ?


ok, i figure it out but it is weird ?

i leave some notes for anyone who will have the same problem

For convert PB to UFF, i follow the example sampleUffSSD and modify config.py to fit my requirement.

you have to specify input placehold format is NCHW

import graphsurgeon as gs
import tensorflow as tf

Input = gs.create_node("InputImage",
    shape=[1, 3, 480, 480])

trt_SpaceToDepth = gs.create_plugin_node(name='spaceToDepth', op="SpaceToDepth_TRT", blockSize=2)

namespace_plugin_map = {
        "image_placeholder": Input,
        "Preprocessor": Input,
        "ToFloat": Input,
        "image_tensor": Input,
        "net/SpaceToDepth": trt_SpaceToDepth

def preprocess(dynamic_graph):
    # Now create a new graph by collapsing namespaces

and here is the weird thing, i read TensorRT document and it clarify the input and output is NCHW format but i have to read output buffer in NHWC format or the result is wrong ! does anyone know why ?


This may be related to the model definition.

For example, if the convolution is applied to the axis=3.
There will be an automatically added converter to transpose tensor from NCHW to NHWC.

@AastaLLL, Thanks for the answer, it really helps.