Hello,
I think that I have the same problem.
This is my configuration:
Windows 10
Pyton - 3.6.8
torch-1.1.0.dist-info
torchsummary-1.5.1.dist-info
torchvision-0.3.0.dist-info
TensorRT - 6.0.1.5
CuDNN - 7.6.3
CUDA - 9.0
I have a segNet CNN implemented by torch and I converted it to onnx using these commands:
dummy_input = torch.randn(1, 32, 400, 400, device='cuda')
input_names = ["Input"]
output_names = ["Output"]
torch.onnx.export(model, dummy_input, "segNet.onnx", verbose=True, input_names=input_names,
output_names=output_names)
At the beginning the command torch.onnx.export was failed due to unsupported max_unpool2d command.
So I updated the file symbolic.py inside the onnx directory of the torch package:
def max_unpool2d(g, self, indices, output_size):
return g.op("max_unpool2d", self, indices, output_size)
After this update the operation torch.onnx.export startes ro work properly without any errors and a segNet.onnx file was successfully generated.
But when i activated this operation:
auto parsed = m_onnxParser->parseFromFile(
fileName.string().c_str(), static_cast<int>(nvinfer1::ILogger::Severity::kINFO));
I got the following report:
----------------------------------------------------------------
Input filename: segNet.onnx
ONNX IR version: 0.0.4
Opset version: 9
Producer name: pytorch
Producer version: 1.1
Domain:
Model version: 0
Doc string:
----------------------------------------------------------------
WARNING: ONNX model has a newer ir_version (0.0.4) than this parser was built against (0.0.3).
While parsing node number 0 [Cast]:
ERROR: builtin_op_importers.cpp:727 In function importCast:
[8] Assertion failed: trt_dtype == nvinfer1::DataType::kHALF && cast_dtype == ::ONNX_NAMESPACE::TensorProto::FLOAT
Any help will be much appreciated