diff --git a/tools/eval_mot.py b/tools/eval_mot.py index 15563866dab6fb9e0252c29710a60ef4a8750183..cce7085171e296760280532bfb8b6acacf4c8011 100644 --- a/tools/eval_mot.py +++ b/tools/eval_mot.py @@ -108,8 +108,17 @@ def main(): check_gpu(cfg.use_gpu) check_version() - place = 'gpu:{}'.format(ParallelEnv().dev_id) if cfg.use_gpu else 'cpu' - place = paddle.set_device(place) + # disable xpu in config by default + if 'use_xpu' not in cfg: + cfg.use_xpu = False + + if cfg.use_gpu: + place = paddle.set_device('gpu') + elif cfg.use_xpu: + place = paddle.set_device('xpu') + else: + place = paddle.set_device('cpu') + run(FLAGS, cfg)