未验证 提交 18f8eaf8 编写于 作者: Z zhangyikun02 提交者: GitHub

enable eval_mot.py to support use_xpu (#5570)

上级 66e4f30a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册