果然一知半解是不得行的!
pip install onnxruntime-gpu
>>> import onnxruntime
>>> onnxruntime.get_device()
'GPU'
>>> onnxruntime.get_available_providers()
['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider']
>>> exit()
session = onnxruntime.InferenceSession(
"YOUR-ONNX-MODEL-PATH",
providers=onnxruntime.get_available_providers()
)