I have a model (pytorch 1.1) which I converted to .onnx (onnx 1.5). I, then, switched from opset 9 to opset 7, as tensorRT supports 7.
I tried parsing it within tensorRT (5.1) but got the following:
ERROR: builtin_op_importers.cpp:704 In function importCast:
[8] Assertion failed: inputs.at(0).is_tensor()
Within the .onnx the operators (the ones around the “Cast”) are as follows:
%176 = MaxPoolkernel_shape = [2, 2], pads = [0, 0, 0, 0], strides = [2, 2]
%177_intermediate_output = Constantvalue =
%177 = Castto = 7
%178 = Reshape(%176, %177)
%179 = Gemm[alpha = 1, beta = 1, transB = 1](%178, %layers.fc.0.0.weight, %layers.fc.0.0.bias)
%180 = Unsqueezeaxes = [2]
%181 = BatchNormalization[epsilon = 9.99999974737875e-06, momentum = 0.899999976158142](%180, %layers.fc.0.1.weight, %layers.fc.0.1.bias, %layers.fc.0.1.running_mean, %layers.fc.0.1.running_var)
%182 = Squeezeaxes = [2]
If I do not switch to opset 7:
%176 = MaxPoolkernel_shape = [2, 2], pads = [0, 0, 0, 0], strides = [2, 2]
%177 = Constantvalue =
%178 = Reshape(%176, %177)
%179 = Gemm[alpha = 1, beta = 1, transB = 1](%178, %layers.fc.0.0.weight, %layers.fc.0.0.bias)
%180 = Unsqueezeaxes = [2]
%181 = BatchNormalization[epsilon = 9.99999974737875e-06, momentum = 0.899999976158142](%180, %layers.fc.0.1.weight, %layers.fc.0.1.bias, %layers.fc.0.1.running_mean, %layers.fc.0.1.running_var)
%182 = Squeezeaxes = [2]
And I get a different error in tensorRT:
ERROR: builtin_op_importers.cpp:1987 In function importUnsqueeze:
[8] Assertion failed: get_shape_size(layer->getOutput(0)->getDimensions()) == get_shape_size(old_shape)
How should I approach the resolution to this? Thanks