From bc9af95607fabf79001766fecc8bf63e2dc562ee Mon Sep 17 00:00:00 2001 From: Villageslayer <63261389+Villageslayer@users.noreply.github.com> Date: Mon, 27 Mar 2023 06:07:28 +0200 Subject: [PATCH] Fixed The AMD_GPU file to not import cuda and added the forgotton torch DML import (#63) * Update main_onnx_amd.py * Update main_onnx_amd.py --- main_onnx_amd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main_onnx_amd.py b/main_onnx_amd.py index 4deff1d..2d6c4ff 100644 --- a/main_onnx_amd.py +++ b/main_onnx_amd.py @@ -1,6 +1,5 @@ import onnxruntime as ort import numpy as np -import cupy as cp import pyautogui import gc import numpy as np @@ -12,6 +11,7 @@ import pandas as pd from utils.general import (cv2, non_max_suppression, xyxy2xywh) import dxcam import torch +import torch_directml def main(): @@ -109,7 +109,7 @@ def main(): npImg = npImg.astype(cp.half) npImg = cp.moveaxis(npImg, 3, 1) - outputs = ort_sess.run(None, {'images': cp.asnumpy(npImg)}) + outputs = ort_sess.run(None, {'images': npImg}) im = torch.from_numpy(outputs[0]).to('cpu')