From 753cb67ab58f7b55fc5061f263654bce3828765b Mon Sep 17 00:00:00 2001 From: Shashi Shekhar Date: Sun, 10 Feb 2019 11:28:52 -0800 Subject: [PATCH] TOCO: Print error message if conversion fails. PiperOrigin-RevId: 233301060 --- tensorflow/lite/toco/toco.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tensorflow/lite/toco/toco.cc b/tensorflow/lite/toco/toco.cc index 4a3d6a58487..aa7e43350ca 100644 --- a/tensorflow/lite/toco/toco.cc +++ b/tensorflow/lite/toco/toco.cc @@ -49,5 +49,10 @@ int main(int argc, char** argv) { } toco::port::InitGoogle(argv[0], effective_argc, &effective_argv, true); auto status = toco::Convert(parsed_toco_flags, parsed_model_flags); - return status.ok() ? 0 : -1; + if (!status.ok()) { + fprintf(stderr, "%s\n", status.error_message().c_str()); + fflush(stderr); + return 1; + } + return 0; }