Open goksinan opened 2 years ago
On possible fix would be that change the line here, so that when K > shape[dim], just take shape[dim] as default.
The ONNX spec doesn't say that's allowed though. It specifies the output shape as having 'k' for the selected axis.
Is it possible that the '3' in the error is due to num_classes being 3 and the model is assuming that there will be 4 or more classes? The default value of num_classes in that pytorch model is 91.
Those numbers in the error message are not fixed. If I use another checkpoint (let's say model_epoch20 rather than model_epoch50), the error message remains, but numbers may change, as in:
Name:‘TopK_1246’ Status Message: k argument [15] should not be greater than specified axis dim value [5]
Another observation that might be useful is that if I just create the model with 3 classes but don't load my weights, the error disappears. So, I get the error when I try to use my own saved model.
Did you solve it? I have the same problem
I'm also interested in this. I have a similar error regarding this exact model (ssdlite320_mobilenet_v3_large) :
RuntimeException
[ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running TopK node. Name:'TopK_6101' Status Message: /onnxruntimesrc/onnxruntime/core/providers/cuda/math/topk.cc:64 onnxruntime::common::Status onnxruntime::cuda::TopK
Is this related?
i got the same issue as well~~~~
RUNTIME_EXCEPTION : Non-zero status code returned while running TopK node. Name:'TopK_1683'
Possibly try a newer version of torchvision. There was a fix checked in to pytorch to try and address this and export the onnx model correctly.
have you solved this problem? imet same issue: Non-zero status code returned while running TopK node. Name:'/model/TopK' Status Message: CUDA error cudaErrorInvalidConfiguration:invalid configuration argument
i'll apreciate if you could help me with my problem! @skottmckay @RandySheriffH
Describe the bug I fine-tuned an SSDlite320 MobileNetV3-Large model using the code provided by torhcvision. The pytorch model was trained nicely and worked as expected. I also successfully exported the pytorch model into .onnx model. However, I keep getting the following error when I try to run the .onnx model using ORT (
ort_session.run(None, {input_name: img})
):[E:onnxruntime:, sequential_executor.cc:368 onnxruntime::SequentialExecutor::Execute] Non-zero status code returned while running TopK node. Name:‘TopK_1254’ Status Message: k argument [4] should not be greater than specified axis dim value [3]
Urgency Needs to be fixed ASAP to be able to run the model using onnxruntime.
System information
To Reproduce This is how I exported to .onnx model:
Additional context I know that detection models sometimes need an actual input image (rather than random input) to be serialized properly. However, the behavior did not change regardless of the input I used during export.