You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
}
`
In the loop, I input tensors of different shapes, but an error occurs when outputting. Is there something wrong with what I wrote?
2024-11-17 09:40:13.789631626 [E:onnxruntime:, sequential_executor.cc:514 ExecuteKernel] Non-zero status code returned while running Softmax node. Name:'p2o.Softmax.2' Status Message: /onnxruntime_src/onnxruntime/core/framework/execution_frame.cc:171 onnxruntime::common::Status onnxruntime::IExecutionFrame::GetOrCreateNodeOutputMLValue(int, int, const onnxruntime::TensorShape*, OrtValue*&, const onnxruntime::Node&) shape && tensor.Shape() == *shape was false. OrtValue shape verification failed. Current shape:{1,12,6625} Requested shape:{1,19,6625}
If you put the line ‘outputTensor1 := []ort.ArbitraryTensor{nil}’ in the loop, the tensor can be output correctly, but the memory will continue to be consumed. Calling destroy() will not release the memory.
The text was updated successfully, but these errors were encountered:
Yes, you'll need to Destroy() the previous tensor and replace the output tensor with nil in every loop if the dimensions may change. It's a limitation of onnxruntime itself---if it's writing output into an existing tensor, it will not be able to change the dimensions. onnxruntime only offers two options for receiving output when running a session:
Write output into an existing tensor that matches all types and dimensions
Allocate an entirely new tensor.
Calling Destroy() will not release the memory
How did you test this? Quite often, simply calling destroy will not cause the GC to be invoked, and onnxruntime may also be caching its own internal data. Have you checked that memory usage will continue to rise if you iterate the loop 100+ times? For example, see my response to a similar issue here: #48 (comment)
If you do see an issue with memory continuing to increase after ~1000 loops, please post a minimal snippet with your test code. The portion of the code for transferring onnxruntime-allocated output tensors into Go-managed Tensors is fairly complicated and I may have made a mistake there.
`func run() {
}
func main() {
}
`
In the loop, I input tensors of different shapes, but an error occurs when outputting. Is there something wrong with what I wrote?
2024-11-17 09:40:13.789631626 [E:onnxruntime:, sequential_executor.cc:514 ExecuteKernel] Non-zero status code returned while running Softmax node. Name:'p2o.Softmax.2' Status Message: /onnxruntime_src/onnxruntime/core/framework/execution_frame.cc:171 onnxruntime::common::Status onnxruntime::IExecutionFrame::GetOrCreateNodeOutputMLValue(int, int, const onnxruntime::TensorShape*, OrtValue*&, const onnxruntime::Node&) shape && tensor.Shape() == *shape was false. OrtValue shape verification failed. Current shape:{1,12,6625} Requested shape:{1,19,6625}
If you put the line ‘outputTensor1 := []ort.ArbitraryTensor{nil}’ in the loop, the tensor can be output correctly, but the memory will continue to be consumed. Calling destroy() will not release the memory.
The text was updated successfully, but these errors were encountered: