From cd60a5f7cbb4b194744bf39d62af1e429b82eb59 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 21 Aug 2019 17:06:54 +0100 Subject: COMPMID-2594: Graph example option parsing doens't fail on invalid values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Report warning/error on invalid argument depending on its importance. Change-Id: I14a855c96d514e6b8a63a61e54410722affa06ce Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/1784 Reviewed-by: Kévin Petit Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins --- examples/graph_alexnet.cpp | 1 + examples/graph_deepspeech_v0_4_1.cpp | 1 + examples/graph_googlenet.cpp | 1 + examples/graph_inception_resnet_v1.cpp | 1 + examples/graph_inception_resnet_v2.cpp | 1 + examples/graph_inception_v3.cpp | 1 + examples/graph_inception_v4.cpp | 1 + examples/graph_lenet.cpp | 1 + examples/graph_mobilenet.cpp | 1 + examples/graph_mobilenet_v2.cpp | 1 + examples/graph_resnet12.cpp | 1 + examples/graph_resnet50.cpp | 1 + examples/graph_resnet_v2_50.cpp | 1 + examples/graph_resnext50.cpp | 1 + examples/graph_shufflenet.cpp | 1 + examples/graph_squeezenet.cpp | 1 + examples/graph_squeezenet_v1_1.cpp | 1 + examples/graph_srcnn955.cpp | 1 + examples/graph_ssd_mobilenet.cpp | 1 + examples/graph_vgg16.cpp | 1 + examples/graph_vgg19.cpp | 1 + examples/graph_vgg_vdsr.cpp | 1 + examples/graph_yolov3.cpp | 1 + 23 files changed, 23 insertions(+) diff --git a/examples/graph_alexnet.cpp b/examples/graph_alexnet.cpp index 88e0d7e54a..79d02f6ba5 100644 --- a/examples/graph_alexnet.cpp +++ b/examples/graph_alexnet.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_deepspeech_v0_4_1.cpp b/examples/graph_deepspeech_v0_4_1.cpp index a69d235944..6af85a585a 100644 --- a/examples/graph_deepspeech_v0_4_1.cpp +++ b/examples/graph_deepspeech_v0_4_1.cpp @@ -45,6 +45,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_googlenet.cpp b/examples/graph_googlenet.cpp index 185680acf9..b768d282ef 100644 --- a/examples/graph_googlenet.cpp +++ b/examples/graph_googlenet.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_inception_resnet_v1.cpp b/examples/graph_inception_resnet_v1.cpp index 64c35e1178..89e44edc33 100644 --- a/examples/graph_inception_resnet_v1.cpp +++ b/examples/graph_inception_resnet_v1.cpp @@ -56,6 +56,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_inception_resnet_v2.cpp b/examples/graph_inception_resnet_v2.cpp index 921fadac4f..424884f16f 100644 --- a/examples/graph_inception_resnet_v2.cpp +++ b/examples/graph_inception_resnet_v2.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_inception_v3.cpp b/examples/graph_inception_v3.cpp index 0a1e312c1f..bce093d0f5 100644 --- a/examples/graph_inception_v3.cpp +++ b/examples/graph_inception_v3.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_inception_v4.cpp b/examples/graph_inception_v4.cpp index a7f57ecdce..bac85eef15 100644 --- a/examples/graph_inception_v4.cpp +++ b/examples/graph_inception_v4.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_lenet.cpp b/examples/graph_lenet.cpp index c75a2f8526..9936ea52ae 100644 --- a/examples/graph_lenet.cpp +++ b/examples/graph_lenet.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_mobilenet.cpp b/examples/graph_mobilenet.cpp index 9c014e747b..c73fd7a765 100644 --- a/examples/graph_mobilenet.cpp +++ b/examples/graph_mobilenet.cpp @@ -52,6 +52,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_mobilenet_v2.cpp b/examples/graph_mobilenet_v2.cpp index 25690aa6fc..15e2c2e05e 100644 --- a/examples/graph_mobilenet_v2.cpp +++ b/examples/graph_mobilenet_v2.cpp @@ -50,6 +50,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_resnet12.cpp b/examples/graph_resnet12.cpp index db70b53d00..33f29dd500 100644 --- a/examples/graph_resnet12.cpp +++ b/examples/graph_resnet12.cpp @@ -54,6 +54,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_resnet50.cpp b/examples/graph_resnet50.cpp index 7c9b95e47e..17506dcf71 100644 --- a/examples/graph_resnet50.cpp +++ b/examples/graph_resnet50.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_resnet_v2_50.cpp b/examples/graph_resnet_v2_50.cpp index 78845a8f6f..785ae9c27a 100644 --- a/examples/graph_resnet_v2_50.cpp +++ b/examples/graph_resnet_v2_50.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_resnext50.cpp b/examples/graph_resnext50.cpp index 766b8ff5fb..4e505a05e5 100644 --- a/examples/graph_resnext50.cpp +++ b/examples/graph_resnext50.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_shufflenet.cpp b/examples/graph_shufflenet.cpp index 3704be7ac1..0a67f5873a 100644 --- a/examples/graph_shufflenet.cpp +++ b/examples/graph_shufflenet.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_squeezenet.cpp b/examples/graph_squeezenet.cpp index 4796dd3ff1..9721775495 100644 --- a/examples/graph_squeezenet.cpp +++ b/examples/graph_squeezenet.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_squeezenet_v1_1.cpp b/examples/graph_squeezenet_v1_1.cpp index fd4561f49a..0fd52b9e19 100644 --- a/examples/graph_squeezenet_v1_1.cpp +++ b/examples/graph_squeezenet_v1_1.cpp @@ -43,6 +43,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_srcnn955.cpp b/examples/graph_srcnn955.cpp index 066f16eb81..b69305889b 100644 --- a/examples/graph_srcnn955.cpp +++ b/examples/graph_srcnn955.cpp @@ -54,6 +54,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_ssd_mobilenet.cpp b/examples/graph_ssd_mobilenet.cpp index e84a00e00a..01d7a866e4 100644 --- a/examples/graph_ssd_mobilenet.cpp +++ b/examples/graph_ssd_mobilenet.cpp @@ -61,6 +61,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_vgg16.cpp b/examples/graph_vgg16.cpp index e8055d4eff..d58bf6cbf5 100644 --- a/examples/graph_vgg16.cpp +++ b/examples/graph_vgg16.cpp @@ -53,6 +53,7 @@ public: // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_vgg19.cpp b/examples/graph_vgg19.cpp index 63051fb056..82895bb516 100644 --- a/examples/graph_vgg19.cpp +++ b/examples/graph_vgg19.cpp @@ -52,6 +52,7 @@ public: // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_vgg_vdsr.cpp b/examples/graph_vgg_vdsr.cpp index 9f0b357a9a..f82ae4c20e 100644 --- a/examples/graph_vgg_vdsr.cpp +++ b/examples/graph_vgg_vdsr.cpp @@ -55,6 +55,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); diff --git a/examples/graph_yolov3.cpp b/examples/graph_yolov3.cpp index c0a97da060..bbc6b729d1 100644 --- a/examples/graph_yolov3.cpp +++ b/examples/graph_yolov3.cpp @@ -44,6 +44,7 @@ public: { // Parse arguments cmd_parser.parse(argc, argv); + cmd_parser.validate(); // Consume common parameters common_params = consume_common_graph_parameters(common_opts); -- cgit v1.2.1