diff --git a/src/model_config_utils.cc b/src/model_config_utils.cc index 598d1894f..68859abdf 100644 --- a/src/model_config_utils.cc +++ b/src/model_config_utils.cc @@ -302,14 +302,19 @@ ValidateIOShape( Status::Code::INVALID_ARG, message_prefix + "must specify 'name'"); } + std::string message_prefix_with_name = + message_prefix + std::string("'" + io.name() + "' "); + if (io.data_type() == inference::DataType::TYPE_INVALID) { return Status( - Status::Code::INVALID_ARG, "model output must specify 'data_type'"); + Status::Code::INVALID_ARG, + message_prefix_with_name + "must specify 'data_type'"); } if (io.dims_size() == 0) { return Status( - Status::Code::INVALID_ARG, message_prefix + "must specify 'dims'"); + Status::Code::INVALID_ARG, + message_prefix_with_name + "must specify 'dims'"); } // If the configuration is non-batching, then no input or output @@ -319,7 +324,7 @@ ValidateIOShape( (max_batch_size == 0)) { return Status( Status::Code::INVALID_ARG, - message_prefix + + message_prefix_with_name + "cannot have empty reshape for non-batching model as scalar " "tensors are not supported"); } @@ -329,7 +334,7 @@ ValidateIOShape( if ((dim < 1) && (dim != triton::common::WILDCARD_DIM)) { return Status( Status::Code::INVALID_ARG, - message_prefix + "dimension must be integer >= 1, or " + + message_prefix_with_name + "dimension must be integer >= 1, or " + std::to_string(triton::common::WILDCARD_DIM) + " to indicate a variable-size dimension"); } @@ -341,7 +346,8 @@ ValidateIOShape( if ((dim < 1) && (dim != triton::common::WILDCARD_DIM)) { return Status( Status::Code::INVALID_ARG, - message_prefix + "reshape dimensions must be integer >= 1, or " + + message_prefix_with_name + + "reshape dimensions must be integer >= 1, or " + std::to_string(triton::common::WILDCARD_DIM) + " to indicate a variable-size dimension"); } @@ -359,7 +365,7 @@ ValidateIOShape( ((reshape_size != 0) || (dims_size != 1))) { return Status( Status::Code::INVALID_ARG, - message_prefix + "has different size for dims and reshape"); + message_prefix_with_name + "has different size for dims and reshape"); } // shape contains variable-size dimension, in this case we compare if @@ -394,7 +400,7 @@ ValidateIOShape( if (dim_element_cnts.size() != reshape_element_cnts.size()) { return Status( Status::Code::INVALID_ARG, - message_prefix + + message_prefix_with_name + "has different number of variable-size dimensions for dims " "and reshape"); } @@ -402,7 +408,8 @@ ValidateIOShape( if (dim_element_cnts[idx] != reshape_element_cnts[idx]) { return Status( Status::Code::INVALID_ARG, - message_prefix + "has different size for dims and reshape"); + message_prefix_with_name + + "has different size for dims and reshape"); } } }