# TensorRT-Question **Repository Path**: xn1997/TensorRT-Question ## Basic Information - **Project Name**: TensorRT-Question - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-16 - **Last Updated**: 2021-06-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## environment > CUDA11.0 > cudnn8.0.1 > TensorRT7.2.1.6 > > CMake3.16 > OPENCV4.4 **python** > torch=1.6 > numpy=1.18 ## Add Custom Einsum Plugin 1. Copy the `Einsum` folder and `CMakeLists.txt` to `TensorRT/plugin/` 2. Compile according to `TensorRT/README.md` 3. Copy `TensorRT/build/out/libnvinfer_plugin.so.7.2.1.so` to `${Your_TensorRT_Path}/TensorRT-7.2.1.6/lib/` ```shell cp TensorRT/build/out/libnvinfer_plugin.so.7.2.1.so ${Your_TensorRT_Path}/TensorRT-7.2.1.6/lib/ ``` ## Problems recur 1. Enter the `sample` folder ```shell cd sample ``` 2. Generate `gcn.onnx` ```shell python generate_onnx.py ``` 3. Modify`sample/CMakeLists.txt` ```cmake include_directories(${Your_TensorRT_Path}/TensorRT-7.2.1.6/include/) file(GLOB_RECURSE trtlib ${Your_TensorRT_Path}/TensorRT-7.2.1.6/lib/*.so) set(OpenCV_DIR "/usr/local/opencv4.4.0/lib/cmake/opencv4") ``` 4. Compiling test samples ```sh cd sample mkdir -p build && cd build cmake .. ``` 5. Running test samples ```shell cd ../bin ./onnx2trt_gcn ``` You will get the following output (this result is wrong) ![image-20210616173324222](https://gitee.com/xn1997/picgo/raw/master/image-20210616173324222.png) The correct output should be the following figure![image-20210616174340723](https://gitee.com/xn1997/picgo/raw/master/image-20210616174340723.png) It seems that the data read by the op has changed. **The input of the plugin should be a matrix of all 1, but actually there are many 0's. I don't know what's wrong with the custom implementation of the plugin** ## About trtexec I compiled `trtexec` as follows ``` cd /samples/trtexec make ``` But when I execute the following command ``` ./trtexec --onnx=gcn.onnx ``` The following error occurred ![image-20210616180940589](https://gitee.com/xn1997/picgo/raw/master/image-20210616180940589.png) **It seems that I didn't detect the plugin I implemented. I didn't find out what the problem was???**