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
Dataset.map() with tf.data.experimental.AUTOTUNE runs out of memory when using batch size=1 #33516
Comments
System Information
Describe the current behaviorI found the same problem as @EduardoGRocha that for batch size 1 and number of parallel calls set to AUTOTUNE for map the memory consumption of the program rises until the program is killed. This problem seems to occur due to an infinite number of calls to the map function. Below you can find a minimal example. Code
|
Could reproduce this issue with TF Version 2.0 in Google Colab, with CPU and GPU as Runtime. Here is the Gist. |
Found the same issue in my project Update: Sorry I am not allowed to share the code for reproducing this problem,
For ppl come across the same issue, it's not recommended to use |
Hello, I faced the same issue. I can confirm that the problem occurs on:
Python version is 3.7.3 |
Update again, this is really a serous bug! With the pipeline in my previous comment, and batch size = 1024, the RAM was eat slowly from ~20% at the start of training to
|
@rachellim could you please take a look? |
Thanks for the repro. Looking into it. |
…l_calls = autotune, batch_size = 1. Closes tensorflow#33516. PiperOrigin-RevId: 281775472 Change-Id: Ie10cea0ef1515d5aff8e3dddadc069ddee1a5a76
This was indeed intriguing. I've submitted a fix, which will be in TF 2.1 :) |
System information
Describe the current behavior
I use Dataset.map to normalize images. When using tf.data.experimental.AUTOTUNE and BATCH_SIZE of 1, memory consumption grows up till the program is killed. The most intriguing part is that when setting the BATCH_SIZE to greater than 1, the program works correctly
This issue happens both with tensorflow 2.0.0 and tensorflow-gpu 2.0.0
Describe the expected behavior
Code should work for batch size of 1
Code to reproduce the issue
Other info / logs
Might be related to Issue #32052
The text was updated successfully, but these errors were encountered: