This commit is contained in:
JimEverest 2022-05-12 13:19:21 +08:00 committed by GitHub
commit 1815b4667e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,6 @@
import argparse
import os
import sys
import platform
import cv2
import numpy as np
import paddle
@ -336,10 +335,11 @@ def get_output_tensors(args, mode, predictor):
def get_infer_gpuid():
sysstr = platform.system()
if sysstr == "Windows":
return 0
if os.name == 'nt':
try:
return int(os.environ['CUDA_VISIBLE_DEVICES'].split(',')[0])
except KeyError:
return 0
if not paddle.fluid.core.is_compiled_with_rocm():
cmd = "env | grep CUDA_VISIBLE_DEVICES"
else: