reverse providers logic

This commit is contained in:
Somdev Sangwan 2023-05-29 23:10:52 +05:30
parent 60dd8888e5
commit 4bb6ea416e
2 changed files with 5 additions and 4 deletions

View File

@ -1,2 +1,4 @@
import onnxruntime
use_gpu = False
providers = ['CPUExecutionProvider']
providers = onnxruntime.get_available_providers()

5
run.py
View File

@ -1,9 +1,8 @@
import sys
import onnxruntime
import core.globals
if '--gpu' in sys.argv:
core.globals.providers = onnxruntime.get_available_providers()
if '--gpu' not in sys.argv:
core.globals.providers = ['CPUExecutionProvider']
import glob
import argparse