training_extensions icon indicating copy to clipboard operation
training_extensions copied to clipboard

otx * utils produce a crash log when executed without args

Open sovrasov opened this issue 2 years ago • 4 comments

Describe the bug

otx export without args should produce a meaningful help message instead of a crash log:

Traceback (most recent call last):
  File "code/training_extensions/.otx/bin/otx", line 8, in <module>
    sys.exit(main())
  File "/code/training_extensions/otx/cli/tools/cli.py", line 77, in main
    results = globals()[f"otx_{name}"]()
  File "/code/training_extensions/otx/cli/tools/export.py", line 68, in main
    config_manager.configure_template()
  File "/code/training_extensions/otx/cli/manager/config_manager.py", line 173, in configure_template
    raise ConfigValueError("Can't find the argument 'train_data_roots'")
otx.cli.utils.errors.ConfigValueError: Can't find the argument 'train_data_roots'

The same is true for other utils.

For instance, benckmark_app produces the following:

[Step 1/11] Parsing and validating input arguments
[ INFO ] Parsing input parameters
usage: benchmark_app [-h [HELP]] [-i PATHS_TO_INPUT [PATHS_TO_INPUT ...]] -m PATH_TO_MODEL [-d TARGET_DEVICE] [-extensions EXTENSIONS] [-c PATH_TO_CLDNN_CONFIG] [-hint {throughput,cumulative_throughput,latency,none}] [-api {sync,async}] [-niter NUMBER_ITERATIONS]
                     [-nireq NUMBER_INFER_REQUESTS] [-b BATCH_SIZE] [-t TIME] [-shape SHAPE] [-data_shape DATA_SHAPE] [-layout LAYOUT] [-nstreams NUMBER_STREAMS] [-latency_percentile LATENCY_PERCENTILE] [-nthreads NUMBER_THREADS] [-pin {YES,NO,NUMA,HYBRID_AWARE}]
                     [-exec_graph_path EXEC_GRAPH_PATH] [-pc [PERF_COUNTS]] [-pcsort {no_sort,sort,simple_sort}] [-pcseq [PCSEQ]] [-inference_only [INFERENCE_ONLY]] [-report_type {no_counters,average_counters,detailed_counters}] [-report_folder REPORT_FOLDER]
                     [-dump_config DUMP_CONFIG] [-load_config LOAD_CONFIG] [-infer_precision INFER_PRECISION] [-ip {u8,U8,f16,FP16,f32,FP32}] [-op {u8,U8,f16,FP16,f32,FP32}] [-iop INPUT_OUTPUT_PRECISION] [-cdir CACHE_DIR] [-lfile [LOAD_FROM_FILE]] [-iscale INPUT_SCALE]
                     [-imean INPUT_MEAN]
benchmark_app: error: the following arguments are required: -m/--path_to_model

sovrasov avatar May 17 '23 12:05 sovrasov

I think this is unintentionally showing the wrong error message, I'll take a look.

harimkang avatar May 18 '23 00:05 harimkang

My guess is that the merge of this PR (https://github.com/openvinotoolkit/training_extensions/pull/2251) should have resolved the issue. Could you please double check and close it?

harimkang avatar Jun 19 '23 08:06 harimkang

Overall, the proposed solution just shows slightly different error, but anyway the failure with an exception occurs. I was wondering if it is possible to fix this at the CLI args parsing level and print a correct help message (like the majority of CLI utils do in that case). If it's not, we could close this with wonftix status.

sovrasov avatar Jun 19 '23 09:06 sovrasov

Overall, the proposed solution just shows slightly different error, but anyway the failure with an exception occurs. I was wondering if it is possible to fix this at the CLI args parsing level and print a correct help message (like the majority of CLI utils do in that case). If it's not, we could close this with wonftix status.

In fact, I'm trying to give a lot of changes to the cli along with the api. I will make improvements based on your comments as well. But it seems difficult to improve right now. As soon as a new design is decided, I will share it with you. :) and it doesn't matter if you leave this issue open.

harimkang avatar Jun 19 '23 10:06 harimkang