How to get features before the fc layer?


When I run the mnist onnx model from github, I find context->executeV2 can only give me the result of fc layer (classification probability).

How can I get features (like the result of layer1/2/3…etc) before the fc layer when parser → onnx model?
(A model like : input->layer1->layer2->layer3->pool->fc-> classification probability)

if caffe:

  1. for (auto& s : outputs)
  2. network->markOutput(*blobNameToTensor->find(s.c_str()));

if uff:

  1. parser->registerInput(“Input_0”, DimsCHW(1, 28, 28), UffInputOrder::kNCHW);

  2. parser->registerOutput(“Binary_3”);

it seems onnx can’t mark out output?
parser->parse(onnx_filename, DataType::kFLOAT);
nvinfer1::INetworkDefinition* trtNetwork = parser->getTRTNetwork();

Hi @414533208,

We can mark outputs of those layers as network outputs before they build the engine.

Thank you.