Hello,
This is my configuration:
Linux distro and version - Linux-x86_64, Ubuntu, 16.04
Python - 3.5.2
VS2017 x64 - Cross platform extension
torch-1.1.0.dist-info
torchsummary-1.5.1.dist-info
torchvision-0.3.0.dist-info
Tensorflow Python\C++ (TF)- 1.9 (C++ version was built from sources)
TensorRT C++ (TRT) - 7.0.0.11
TensorRT Open Source https://github.com/NVIDIA/TensorRT - master
GPU type - GeForce GTX 1080
nvidia driver version - 418.40.04
CUDA version - Release 9.0, V9.0.252
I have a SegNet model which implemeted and trained via PyTorch, Intended to be inferenced via TRT C++.
When I activate this function:
auto parsed = m_onnxParser->parseFromFile(
fileName.string().c_str(), static_cast<int>(nvinfer1::ILogger::Severity::kINFO));
I’m getting the following report:
----------------------------------------------------------------
Input filename: ../../../../Data/SegNet/Semantic_Segmentation/segNet.onnx
ONNX IR version: 0.0.4
Opset version: 9
Producer name: pytorch
Producer version: 1.1
Domain:
Model version: 0
Doc string:
----------------------------------------------------------------
......
some verbose information
......
ModelImporter.cpp:107: Parsing node: [MaxPool]
VERBOSE:
ModelImporter.cpp:123: Searching for input: 188
VERBOSE:
ModelImporter.cpp:129: [MaxPool] inputs: [188 -> (1, 64, 400, 400)],
VERBOSE:
ImporterContext.hpp:122: Registering layer: (Unnamed Layer* 12) [Pooling] for ONNX node:
VERBOSE:
ImporterContext.hpp:97: Registering tensor: 195 for ONNX tensor: 195
Exception - invalid vector<T> subscript!!!
I used the TensorRT OSS package to investigate what is the problem source.
I built its master version from source on my Linux station successfully and executed the onnx2trt application.
I got that the exception is raised in:
File - ModelImporter.cpp
Function - parseGraph
Line number - 172
Line -
auto& output = outputs.at(i);
I made some further debugging and I realized that this line:
GET_VALUE(importFunc(ctx, node, nodeInputs), &outputs);
fill the outputs vector with only one element.
While this line:
node.output().size()
return 2 which is actually true.
And this is the root cause of the exception.
Why importFunc return a vector with only one element?
Please advise.
Regard