I’m trying to deploy a CNN using tensorrt. The CNN is trained using pytorch, and can be exported to ONNX format easily.
In the forward() pass, there is a reshape between the feature maps and fully connected layers.
My version is:
h = h.view(-1, 20*14*14) # the size -1 is inferred from other dimensions
but ‘-1’ inference do not work in the python tensorrt onnx parser.
I got a error:
terminate called after throwing an instance of 'std::out_of_range' what(): Attribute not found: shape Aborted (core dumped)
I have to specify the first value.