diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 21bbee098ef19456d05165969a9ad400400f1264..213418a8e62ac9d560019d0ea885b54a7ec22d33 100644 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -15,6 +15,7 @@ import argparse import os import sys +import platform import cv2 import numpy as np import paddle @@ -313,6 +314,10 @@ def create_predictor(args, mode, logger): def get_infer_gpuid(): + sysstr = platform.system() + if sysstr == "Windows": + return 0 + if not paddle.fluid.core.is_compiled_with_rocm(): cmd = "env | grep CUDA_VISIBLE_DEVICES" else: