From b789b70cf5c9fb8c6fdf5f9a59d015e327e1b401 Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Mon, 27 Dec 2021 07:10:32 +0000 Subject: [PATCH] add system judge --- tools/infer/utility.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 21bbee09..213418a8 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: -- GitLab