-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify why TextVectorization works on CPU #913
Clarify why TextVectorization works on CPU #913
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR. Please regenerate the ipynb
and md
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -614,6 +638,7 @@ print("Model output:", test_output) | |||
|
|||
<div class="k-default-codeblock"> | |||
``` | |||
WARNING:tensorflow:5 out of the last 1567 calls to <function PreprocessingLayer.make_adapt_function.<locals>.adapt_step at 0x7f80ec464a60> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattdangerw @fchollet Note the warnings in the output after regenerating .md
and Jupyter files
Downloading data from https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz | ||
170498071/170498071 [==============================] - 14s 0us/step | ||
|
||
2022-06-15 15:02:40.512792: W tensorflow/core/framework/cpu_allocator_impl.cc:82] Allocation of 153600000 exceeds 10% of free system memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattdangerw @fchollet Maybe we should make the output in cells less verbose.
@@ -116,6 +116,14 @@ print("Features std: %.2f" % (normalized_data.numpy().std())) | |||
|
|||
<div class="k-default-codeblock"> | |||
``` | |||
2022-06-15 15:02:07.223345: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattdangerw @fchollet Note the new messages in the output after regenerating the notebook and Markdown files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll remove the warnings in post. Thanks!
As discussed with @fchollet @mattdangerw @MarkDaoust
This PR introduces the following improvements:
TextVectorization
layer should be used as part of atf.data
input pipeline (runs only on CPUs, won't utilize hardware acceleration if included inside aModel
, affecting performance).