Tensorrt: Some bugs in "ICaffeParser"

Created on 11 Nov 2019  Â·  3Comments  Â·  Source: NVIDIA/TensorRT

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!!

Caffe enhancement help wanted

Most helpful comment

The Caffe parser does not currently support dynamic input shapes.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhkim0225 picture dhkim0225  Â·  4Comments

MachineJeff picture MachineJeff  Â·  5Comments

sbbug picture sbbug  Â·  5Comments

stengoes picture stengoes  Â·  6Comments

mhansinger picture mhansinger  Â·  4Comments