From 44ff3b93fba964d340b34e8c37684e083dbc3fa3 Mon Sep 17 00:00:00 2001 From: maxsitt <87697856+maxsitt@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:02:24 +0100 Subject: [PATCH] Revert "Use onnxruntime-gpu" This reverts commit 41d650fdcc66446810c42e0f5d0f911f11f61064. --- classify/predict.py | 2 +- classify/val.py | 2 +- export.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classify/predict.py b/classify/predict.py index 0f0496e164dd..6b34a7e7ab43 100644 --- a/classify/predict.py +++ b/classify/predict.py @@ -397,7 +397,7 @@ def parse_opt(): def main(opt): - check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop', 'onnxruntime')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/classify/val.py b/classify/val.py index 29f961ac2bb8..a4205eb4ed51 100644 --- a/classify/val.py +++ b/classify/val.py @@ -249,7 +249,7 @@ def parse_opt(): def main(opt): - check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop', 'onnxruntime')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/export.py b/export.py index 6d763d6ac9a6..71e4eb94d1c4 100644 --- a/export.py +++ b/export.py @@ -192,7 +192,7 @@ def export_onnx(model, im, file, opset, dynamic, simplify, prefix=colorstr('ONNX if simplify: try: cuda = torch.cuda.is_available() - check_requirements(('onnxruntime-gpu', 'onnx-simplifier>=0.4.1')) + check_requirements(('onnxruntime-gpu' if cuda else 'onnxruntime', 'onnx-simplifier>=0.4.1')) import onnxsim LOGGER.info(f'{prefix} simplifying with onnx-simplifier {onnxsim.__version__}...')