Skip to content

Commit 547c9a2

Browse files
author
Roman Donchenko
authored
Merge pull request #1069 from IRDonch/converter-option-consistency
Model converter: use a consistent naming convention for options
2 parents 81df1a3 + 6c0e8c5 commit 547c9a2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tools/downloader/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ script. You can override this heuristic with the `--mo` option:
259259
```
260260

261261
You can add extra Model Optimizer arguments to the ones specified in the model
262-
configuration by using the `--add-mo-arg` option. The option can be repeated
262+
configuration by using the `--add_mo_arg` option. The option can be repeated
263263
to add multiple arguments:
264264

265265
```sh
266-
./converter.py --name=caffenet --add-mo-arg=--reverse_input_channels --add-mo-arg=--silent
266+
./converter.py --name=caffenet --add_mo_arg=--reverse_input_channels --add_mo_arg=--silent
267267
```
268268

269269
By default, the script will run Model Optimizer using the same Python executable
@@ -286,10 +286,10 @@ executed commands, or "auto", in which case the number of CPUs in the system is
286286
By default, all commands are run sequentially.
287287

288288
The script can print the conversion commands without actually running them.
289-
To do this, use the `--dry-run` option:
289+
To do this, use the `--dry_run` option:
290290

291291
```sh
292-
./converter.py --all --dry-run
292+
./converter.py --all --dry_run
293293
```
294294

295295
See the "Shared options" section for information on other options accepted by

tools/downloader/converter.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,17 @@ def main():
135135
help='Python executable to run Model Optimizer with')
136136
parser.add_argument('--mo', type=Path, metavar='MO.PY',
137137
help='Model Optimizer entry point script')
138-
parser.add_argument('--add-mo-arg', dest='extra_mo_args', metavar='ARG', action='append',
138+
parser.add_argument('--add_mo_arg', dest='extra_mo_args', metavar='ARG', action='append',
139139
help='Extra argument to pass to Model Optimizer')
140-
parser.add_argument('--dry-run', action='store_true',
140+
parser.add_argument('--dry_run', action='store_true',
141141
help='Print the conversion commands without running them')
142142
parser.add_argument('-j', '--jobs', type=num_jobs_arg, default=1,
143143
help='number of conversions to run concurrently')
144+
145+
# aliases for backwards compatibility
146+
parser.add_argument('--add-mo-arg', dest='extra_mo_args', action='append', help=argparse.SUPPRESS)
147+
parser.add_argument('--dry-run', action='store_true', help=argparse.SUPPRESS)
148+
144149
args = parser.parse_args()
145150

146151
mo_path = args.mo

0 commit comments

Comments
 (0)