TensorRT
TensorRT copied to clipboard
How use TensorRT API to add conv1d layers?
Description
I want to use TensorRT API to rebuild a model, which contains some conv1d layers [use torch.Conv1d()]. Inputs shape is [1,1,82000], and the output of conv1d is [1,512,16399], kernel_size = 10, stride = 5, padding = 0. Some code is below:
auto conv = newtork->addConvolutionNd(input, 512, DimsHW{10, 1}, weight, bias);
conv->setStrideNd(DimsHW{5,1 });
But it failed. The error is below:
[graphShapeAnalyzer.cpp::addVolumeCheck::610] Error Code 9: Internal Error (output: dimension 1 never exceeds -1)
Error Code 4: Internal Error (Could not compute dimensions for output, because the network is not valid.)
How use addConvolutionNd() to add conv layer to network?
@nvpohanh ^ ^
Description
I want to use TensorRT API to rebuild a model, which contains some conv1d layers [
use torch.Conv1d()]. Inputs shape is [1,1,82000], and the output of conv1d is [1,512,16399], kernel_size = 10, stride = 5, padding = 0. Some code is below:auto conv = newtork->addConvolutionNd(input, 512, DimsHW{10, 1}, weight, bias);conv->setStrideNd(DimsHW{5,1 });But it failed. The error is below:[graphShapeAnalyzer.cpp::addVolumeCheck::610] Error Code 9: Internal Error (output: dimension 1 never exceeds -1)Error Code 4: Internal Error (Could not compute dimensions for output, because the network is not valid.)How use addConvolutionNd() to add conv layer to network?
I also had the same problem
Inputs shape
try to reshape the input to [1,1,82000, 1], the inputshape of the addConvolutionNd should be a dims4 itensor
TRT doesn't support 1D-Conv yet. You need to first unsqueeze the tensor, add it as a 2D conv, and then squeeze the tensor
Closing since no activity for more than 3 weeks, please reopen if you still have question, thanks!