-
Notifications
You must be signed in to change notification settings - Fork 74.2k
-
Notifications
You must be signed in to change notification settings - Fork 74.2k
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
Excessive memory consumption and preparation runtime of tf.keras.backend.max in custom layer with masking #37479
Comments
Thanks. I can confirm the issue. |
I would like to kindly ask, if there are any news on this issue? |
This issue has been inactive for one month now. I would appreciate some feedback very much. Thank you. |
@gadagashwini @gowthamkpr @fchollet Is there any chance that a tensorflower comments on this issue? That would be very kind. Thank you. |
@padoremu Please post this issue on keras-team/keras repo. |
@Saduf2019 Since this issue was created one and a half years ago, as you can imagine I had to find ways to avoid needing this kind of functionality. Please feel free to move this issue to kears-team/keras repo. My motivation to invest more time in communicating and documenting this problem is limited. Of course I would still be interested in a solution / fix. Anybody can easily reproduce the problem with the initially posted code - that's all one needs. Thank you. |
Hi There, This is a stale issue. As you are using an older version of tensorflow, we are checking to see if you still need help on this issue. Please test the issue with the latest TensorFlow (TF2.7 and tf-nightly). If the issue still persists with the newer versions of TF, please feel free to open it in keras-team/keras repository by providing details about the issue and a standalone code to reproduce the issue. Thanks! Please note that Keras development has moved to a separate Keras-team/keras repository to focus entirely on only Keras. Thanks! |
System information
Describe the current behavior
Memory consumption seems to be proportional to
num_iterations
and thus excessive, most likely being a memory leak. Runtime until seeing the first fit result is also extremely slow: 15 seconds until the first fit call, 55 seconds until seeing the result of the first fit, and the other fits run through in less than a second. Apparently, runtime is due to memory management and not due to the actual max function evaluation.When using
tf.keras.backend.max
for computing a mask withtf.stack
in a real setup, memory consumption increases steadily until running out of memory at approx. 30 GB. In contrast, withoutcompute_mask
, memory consumption doesn't go beyond approx 1 GB.Describe the expected behavior
I would expect memory consumption to be independent of
num_iterations
and thus being much lower, plus preparation runtime being much lower.Code to reproduce the issue
Other info / logs
If my usage of
tf.keras.backend.max
is wrong with regard to memory consumption and / or runtime, please let me know. I need to call it frequently withincompute_mask
for computing a custom mask in conjunction withtf.stack
. However, the latter does not seem to be the problem, which is why I left it out in the stripped down code.The text was updated successfully, but these errors were encountered: