onnx-tensorrt icon indicating copy to clipboard operation
onnx-tensorrt copied to clipboard

In function importTopK: [8] Assertion failed: inputs.at(1).is_weights()

Open rgc183 opened this issue 5 years ago • 6 comments

from https://github.com/onnx/onnx/blob/master/docs/Operators.md#topk second input seems to be 1-D tensor with single value, however, importer for TopK expects second input to be weight and crashes.

Whats the workaround for this?

rgc183 avatar May 05 '20 21:05 rgc183

Do you solve it? By how

KevenLee avatar Jun 11 '20 07:06 KevenLee

@rgc183 did you solve it?

simutisernestas avatar Dec 07 '20 17:12 simutisernestas

Hi all, TensorRT unfortunately only supports constant values for k in its TopK layer.

Are the K values in the models actually dynamic? Perhaps they can be constant-folded using the following library: https://github.com/daquexian/onnx-simplifier

kevinch-nv avatar Dec 28 '20 18:12 kevinch-nv

I'm also very interested in this.

dmenig avatar Feb 02 '21 16:02 dmenig

@kevinch-nv Hi, I'm facing the same problem and K of TopK should be dynamic if we feed dynamic input into a model using TensorRT. And in ONNXRuntime the K is dynamic. BTW, is there any plan on this issue? Thanks.

RunningLeon avatar Feb 26 '21 08:02 RunningLeon

Hi all, TensorRT unfortunately only supports constant values for k in its TopK layer.

Are the K values in the models actually dynamic? Perhaps they can be constant-folded using the following library: https://github.com/daquexian/onnx-simplifier

found your many answers are not the quesqtions's answers., please seriously.

wkl2013DeepVision avatar May 13 '21 09:05 wkl2013DeepVision