From 6448bb32487e0c869c2a6fddb8e31901a9e38a84 Mon Sep 17 00:00:00 2001 From: Andrew Selle Date: Fri, 26 Oct 2018 15:10:25 -0700 Subject: [PATCH] Add github template and request op compatibility bug reports. New template is for tf lite operation compatibility. Exporter now prints a message referring to this templat. PiperOrigin-RevId: 218921105 --- ...e-issue.md => 00-bug-performance-issue.md} | 0 ...ssue.md => 10-build-installation-issue.md} | 0 ...ion-issue.md => 20-documentation-issue.md} | 0 ...ature-request.md => 30-feature-request.md} | 0 .../{other-issues.md => 50-other-issues.md} | 0 tensorflow/contrib/lite/toco/tflite/export.cc | 23 +++++++++++++++++++ 6 files changed, 23 insertions(+) rename .github/ISSUE_TEMPLATE/{bug-performance-issue.md => 00-bug-performance-issue.md} (100%) rename .github/ISSUE_TEMPLATE/{build-installation-issue.md => 10-build-installation-issue.md} (100%) rename .github/ISSUE_TEMPLATE/{documentation-issue.md => 20-documentation-issue.md} (100%) rename .github/ISSUE_TEMPLATE/{feature-request.md => 30-feature-request.md} (100%) rename .github/ISSUE_TEMPLATE/{other-issues.md => 50-other-issues.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug-performance-issue.md b/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug-performance-issue.md rename to .github/ISSUE_TEMPLATE/00-bug-performance-issue.md diff --git a/.github/ISSUE_TEMPLATE/build-installation-issue.md b/.github/ISSUE_TEMPLATE/10-build-installation-issue.md similarity index 100% rename from .github/ISSUE_TEMPLATE/build-installation-issue.md rename to .github/ISSUE_TEMPLATE/10-build-installation-issue.md diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.md b/.github/ISSUE_TEMPLATE/20-documentation-issue.md similarity index 100% rename from .github/ISSUE_TEMPLATE/documentation-issue.md rename to .github/ISSUE_TEMPLATE/20-documentation-issue.md diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/30-feature-request.md similarity index 100% rename from .github/ISSUE_TEMPLATE/feature-request.md rename to .github/ISSUE_TEMPLATE/30-feature-request.md diff --git a/.github/ISSUE_TEMPLATE/other-issues.md b/.github/ISSUE_TEMPLATE/50-other-issues.md similarity index 100% rename from .github/ISSUE_TEMPLATE/other-issues.md rename to .github/ISSUE_TEMPLATE/50-other-issues.md diff --git a/tensorflow/contrib/lite/toco/tflite/export.cc b/tensorflow/contrib/lite/toco/tflite/export.cc index 02ce3d06b97..30efd67f8c2 100644 --- a/tensorflow/contrib/lite/toco/tflite/export.cc +++ b/tensorflow/contrib/lite/toco/tflite/export.cc @@ -438,6 +438,8 @@ tensorflow::Status Export( } } + // The set of used builtin ops. + std::set builtin_ops; // The set of custom ops (not including Flex ops). std::set custom_ops; // The set of Flex ops which are not supported. @@ -451,6 +453,10 @@ tensorflow::Status Export( if (key.is_unsupported_flex_op()) { unsupported_flex_ops.insert(key.flex_tensorflow_op()); } + if (!key.is_custom_op() && !key.is_flex_op() && + !key.is_unsupported_flex_op()) { + builtin_ops.insert(EnumNameBuiltinOperator(key.type())); + } } if (!custom_ops.empty()) { @@ -471,18 +477,32 @@ tensorflow::Status Export( custom_ops_final = custom_ops; } + auto please_report_bug_message = []() { + return "We are continually in the process of adding support to " + "TensorFlow Lite for more ops. It would be helpful if you could " + "inform us of how this conversion went by opening a github " + "issue at " + "https://github.com/tensorflow/tensorflow/issues/new?template=" + "40-tflite-op-request.md\n and pasting the following:\n\n"; + }; + if (params.allow_flex_ops) { return tensorflow::errors::InvalidArgument(absl::StrCat( + please_report_bug_message(), "Some of the operators in the model are not supported by " "the standard TensorFlow Lite runtime and are not recognized by " "TensorFlow. If you have a custom " "implementation for them you can disable this error with " "--allow_custom_ops, or by setting allow_custom_ops=True " "when calling tf.contrib.lite.TFLiteConverter(). Here is a list " + "of builtin operators you are using: ", + absl::StrJoin(builtin_ops, ", "), + ". Here is a list " "of operators for which you will need custom implementations: ", absl::StrJoin(custom_ops_final, ", "), ".")); } else { return tensorflow::errors::InvalidArgument(absl::StrCat( + please_report_bug_message(), "Some of the operators in the model are not supported by " "the standard TensorFlow Lite runtime. If those are native " "TensorFlow operators, you might be able to use the extended " @@ -492,6 +512,9 @@ tensorflow::Status Export( "custom implementation for them you can disable this error with " "--allow_custom_ops, or by setting allow_custom_ops=True " "when calling tf.contrib.lite.TFLiteConverter(). Here is a list " + "of builtin operators you are using: ", + absl::StrJoin(builtin_ops, ", "), + ". Here is a list " "of operators for which you will need custom implementations: ", absl::StrJoin(custom_ops_final, ", "), ".")); }