Fix AMD by changing from GetTensorData<T>() to GetTensorMutableData<T>()
This commit is contained in:
@@ -726,7 +726,7 @@ namespace ANSCENTER {
|
||||
std::vector<Object> ANSONNXSEG::postprocess(
|
||||
const cv::Size& origSize,
|
||||
const cv::Size& letterboxSize,
|
||||
const std::vector<Ort::Value>& outputs,
|
||||
std::vector<Ort::Value>& outputs,
|
||||
const std::string& camera_id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(_mutex);
|
||||
@@ -738,9 +738,11 @@ namespace ANSCENTER {
|
||||
std::to_string(outputs.size()));
|
||||
}
|
||||
|
||||
// Extract output tensors
|
||||
const float* detections = outputs[0].GetTensorData<float>();
|
||||
const float* prototypes = outputs[1].GetTensorData<float>();
|
||||
// Extract output tensors. GetTensorMutableData (not GetTensorData)
|
||||
// on DML — const variant hangs on AMD after ~8 calls. Read-only
|
||||
// despite the name.
|
||||
const float* detections = outputs[0].GetTensorMutableData<float>();
|
||||
const float* prototypes = outputs[1].GetTensorMutableData<float>();
|
||||
|
||||
// Get tensor shapes
|
||||
auto detectionShape = outputs[0].GetTensorTypeAndShapeInfo().GetShape(); // [1, 116, N]
|
||||
|
||||
Reference in New Issue
Block a user