Fix AMD by changing from GetTensorData<T>() to GetTensorMutableData<T>()
This commit is contained in:
@@ -1089,7 +1089,7 @@ namespace ANSCENTER {
|
||||
std::vector<Object> ANSONNXOBB::postprocess(
|
||||
const cv::Size& originalImageSize,
|
||||
const cv::Size& resizedImageShape,
|
||||
const std::vector<Ort::Value>& outputTensors,
|
||||
std::vector<Ort::Value>& outputTensors,
|
||||
int topk,
|
||||
const std::string& camera_id)
|
||||
{
|
||||
@@ -1103,8 +1103,10 @@ namespace ANSCENTER {
|
||||
return {};
|
||||
}
|
||||
|
||||
// Extract output tensor data and shape [1, num_features, num_detections]
|
||||
const float* rawOutput = outputTensors[0].GetTensorData<float>();
|
||||
// Extract output tensor data and shape [1, num_features, num_detections].
|
||||
// GetTensorMutableData (not GetTensorData) on DML — const variant
|
||||
// hangs on AMD after ~8 calls. Read-only despite the name.
|
||||
const float* rawOutput = outputTensors[0].GetTensorMutableData<float>();
|
||||
const std::vector<int64_t> outputShape = outputTensors[0].GetTensorTypeAndShapeInfo().GetShape();
|
||||
|
||||
if (outputShape.size() < 3) {
|
||||
|
||||
Reference in New Issue
Block a user