Skip to content

Commit af13086

Browse files
authored
Fix capture_output (#125)
1 parent a2b3ab3 commit af13086

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/en/tutorials/how_to_support_new_backends.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The backends in MMDeploy must support the ONNX. The backend loads the ".onnx" fi
9494
f'--input_shape="{input_shapes}" ' \
9595
f'--disable_fusing '
9696
command = f'mo.py {mo_args}'
97-
mo_output = run(command, capture_output=True, shell=True, check=True)
97+
mo_output = run(command, stdout=PIPE, stderr=PIPE, shell=True, check=True)
9898
```
9999

100100
**Use executable program:**

mmdeploy/backend/openvino/onnx2openvino.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22
import os.path as osp
33
import subprocess
4-
from subprocess import CalledProcessError, run
4+
from subprocess import PIPE, CalledProcessError, run
55
from typing import Dict, List, Union
66

77
import mmcv
@@ -86,7 +86,7 @@ def onnx2openvino(input_info: Dict[str, Union[List[int], torch.Size]],
8686

8787
logger = get_root_logger()
8888
logger.info(f'Args for Model Optimizer: {command}')
89-
mo_output = run(command, capture_output=True, shell=True, check=True)
89+
mo_output = run(command, stdout=PIPE, stderr=PIPE, shell=True, check=True)
9090
logger.info(mo_output.stdout.decode())
9191
logger.debug(mo_output.stderr.decode())
9292

0 commit comments

Comments
 (0)