How to solve the problem while installing torch2trt with plugins

Description

A problem happened when I tried to install torch2trt with plugins after solving the problem "fatal error: NvInfer.h: No such file or directory

"

Environment

TensorRT Version: 7.0.0
GPU Type: 2080ti
CUDA Version: 10.0
Operating System + Version: Ubuntu 16.04 LTS
Python Version (if applicable): 3.6
PyTorch Version (if applicable): 1.7.0

Shell output text

torch2trt/plugins/group_norm.cpp: In member function ‘void torch2trt::GroupNormPlugin::deserializeFromString(const string&)’:
torch2trt/plugins/group_norm.cpp:52:24: error: cannot convert ‘std::vector’ to ‘int64_t {aka long int}’ in assignment
num_groups = value.toIntListRef().vec();
^
torch2trt/plugins/group_norm.cpp:72:17: error: cannot convert ‘std::vector’ to ‘double’ in assignment
eps = value.toDoubleListRef().vec();
^
torch2trt/plugins/group_norm.cpp: In member function ‘std::string torch2trt::GroupNormPlugin::serializeToString() const’:
torch2trt/plugins/group_norm.cpp:108:70: warning: ‘c10::IValue::IValue(std::vector)’ is deprecated [-Wdeprecated-declarations]
output_archive.write(“input_sizes”, torch::IValue(input_sizes));
^
In file included from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/ivalue.h:636:0,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/stack.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/ATenDispatch.h:15,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/TensorMethods.h:10,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/Tensor.h:12,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/Context.h:4,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/ATen.h:5,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/extension.h:4,
from torch2trt/plugins/plugins.cpp:1:
/home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/ivalue_inl.h:616:8: note: declared here
inline IValue::IValue(std::vector<int64_t> v)
^
In file included from torch2trt/plugins/plugins.cpp:3:0:
torch2trt/plugins/group_norm.cpp:109:72: warning: ‘c10::IValue::IValue(std::vector)’ is deprecated [-Wdeprecated-declarations]
output_archive.write(“output_sizes”, torch::IValue(output_sizes));
^
In file included from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/ivalue.h:636:0,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/stack.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/ATenDispatch.h:15,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/TensorMethods.h:10,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/Tensor.h:12,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/Context.h:4,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/ATen.h:5,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /home/hlf/.local/lib/python3.5/site-packages/torch/include/torch/extension.h:4,
from torch2trt/plugins/plugins.cpp:1:
/home/hlf/.local/lib/python3.5/site-packages/torch/include/ATen/core/ivalue_inl.h:616:8: note: declared here
inline IValue::IValue(std::vector<int64_t> v)
^
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Hi,
Please refer to below links related custom plugin implementation and sample:
https://docs.nvidia.com/deeplearning/tensorrt/sample-support-guide/index.html#onnx_packnet

While IPluginV2 and IPluginV2Ext interfaces are still supported for backward compatibility with TensorRT 5.1 and 6.0.x respectively, however, we recommend that you write new plugins or refactor existing ones to target the IPluginV2DynamicExt or IPluginV2IOExt interfaces instead.

Thanks!