Skip to content

Commit c6dcd60

Browse files
gagikaaichendouble
andauthored
Catch tf.text NotFoundError: (#9962)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.so: undefined symbol: _ZN10tensorflow6StatusC1ENS_5error4CodeEN4absl12lts_2021032411string_viewEOSt6vectorINS_10StackFrameESaIS7_EE PiperOrigin-RevId: 368978629 Co-authored-by: Chen Chen <[email protected]>
1 parent 98b0763 commit c6dcd60

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

official/nlp/modeling/layers/text_layers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
import tensorflow_text as text # pylint: disable=g-import-not-at-top
2323
except ImportError:
2424
text = None
25+
except tf.errors.NotFoundError as e:
26+
logging.warn("Encountered error when importing tensorflow_text: %s", e)
27+
text = None
2528

2629

2730
def _check_if_tf_text_installed():

0 commit comments

Comments
 (0)