Skip to content

Commit 753cb67

Browse files
TOCO: Print error message if conversion fails.
PiperOrigin-RevId: 233301060
1 parent beccb5b commit 753cb67

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tensorflow/lite/toco/toco.cc

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,10 @@ int main(int argc, char** argv) {
4949
}
5050
toco::port::InitGoogle(argv[0], effective_argc, &effective_argv, true);
5151
auto status = toco::Convert(parsed_toco_flags, parsed_model_flags);
52-
return status.ok() ? 0 : -1;
52+
if (!status.ok()) {
53+
fprintf(stderr, "%s\n", status.error_message().c_str());
54+
fflush(stderr);
55+
return 1;
56+
}
57+
return 0;
5358
}

0 commit comments

Comments
 (0)