I used "ICaffeParser" to parse caffemodel and prototxt as follows:
INetworkDefinition* network = builder->createNetworkV2(1U << static_cast<uint32_t>(NetworkDefinitionCreationFlag::kEXPLICIT_BATCH));
const IBlobNameToTensor* blobNameToTensor = parser->parse(deployFile,modelFile, *network, nvinfer1::DataType::kFLOAT);
There is a "Permute" layer in prototxt. Like that:
layer {
name: "permute"
type: "Permute"
bottom: "conv1"
top: "conv1_permute"
permute_param{
order: 0
order: 3
order: 2
order: 1
}
}
If the size of input layer is fixed, all is ok.
However, if the size is dynamic as follows:
input: "data"
input_shape {
dim: 1
dim: 1
dim: 32
dim: -1
}
errors occured:
caffe/caffeParser.cpp:1599: nvinfer1::ILayer* parsePermute(nvinfer1::INetworkDefinition&, const ditcaffe::LayerParameter&, CaffeWeightFactory&, BlobNameToTensor&): Assertion `volume(topDims) == volume(bottomDims)' failed.
environments:
tensorrt 6.0.1.5
OS: centos 7.2
cuda10.0
titan RTX
help me!!
The Caffe parser does not currently support dynamic input shapes.
If remove the Permute layer, Caffe parser can correctly parse the caffe model with dynamic input shapes.
So, I guess just because there are some errors in Permute layer?
@pranavm-nvidia
You would see similar issues in any layers that operate on the shape directly, e.g. reshape, unsqueeze, transpose etc. I think other layers might happen to work, but the parser has not yet been upgraded to fully support dynamic shapes.
Most helpful comment
The Caffe parser does not currently support dynamic input shapes.