TOCO: Print error message if conversion fails.

PiperOrigin-RevId: 233301060
This commit is contained in:
Shashi Shekhar 2019-02-10 11:28:52 -08:00 committed by TensorFlower Gardener
parent beccb5be1d
commit 753cb67ab5

View File

@ -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;
}