I am using the Python API and I would like to get the output of an hidden layer after the execution of an engine. Is this possible?
We can set the layer as a network output and bind a buffer to it to collect the output.
The engine is built in C++ and run in Python. Can I do that while loading the engine in Python or should I do that when building it in C++? You can refer to this repository: tensorrtx/yolov5 at master · wang-xinyu/tensorrtx · GitHub
We cannot do while loading. We need to set the layer as a network output and regenerate the engine.
Hello. Do you have an example? Thank you
So rebuilding the engine means redoing the torch->onnx->trt? Cut the output I want from the existing torch model. Is it possible to output multiple layers? Do I have to make this separately?