Comments (6)
We can now create a context manager with dataloader (#78), so we can properly release the memory after each loop with:
train = nvt.Dataset(files, part_size="100MB")
for j in range(250):
with Loader(train, batch_size=1024 * 64, shuffle=True, drop_last=True) as train_dl:
for i, (inputs, labels) in enumerate(train_dl):
# do stuff
instead of using dataloader.stop()
which is easy to forget to do.
I confirmed that the memory is properly released by using a context manager in the original script.
from dataloader.
The potential solution is to call train_dl.stop()
before del train, train_dl
.
from dataloader.
@benfred , please check if there is a fix from @oliverholworthy and link it. Thank you
from dataloader.
@bschifferer did you test that solution and did it work?
from dataloader.
I need to call train_dl.stop()
that all elements in the queue are deleted
from dataloader.
one hypothesis is we might need to implement __del__
to automatically clean itself up for the case where the dataloader doesn't get entirely consumed and the object goes out of scope. Or make it possible to use the loader as a context manager to handle this.
from dataloader.
Related Issues (20)
- Change dataloader to output 1D tensors for scalar features HOT 1
- GPU is not detected properly when using SLURM HOT 5
- GPU memory does not get freed up properly after each batch HOT 5
- Dataloader does not work with tf.keras.layers.Embedding HOT 7
- Device assignment does not work in PyTorch HOT 4
- Out-of-memory error when iterating over merlin.dataloader.torch.Loader HOT 1
- PyTorch Loader not working HOT 1
- [BUG] Unable to extract session embeddings from a session-based transformer model HOT 3
- NVTabular KerasSequenceLoader cost long time to load data HOT 3
- How to use dataloader without NVTabular? HOT 1
- [Bug] Conda install command in README cannot find merlin-loader package HOT 1
- Support for images from spark DataFrame
- Can't import Loader HOT 4
- [Task] Add multi-gpu data parallel example
- [Feature Request] Make the torch dataloader support TensorDict
- Does this work with images? HOT 1
- [BUG] Exception in model when using ragged tensors with tensorflow 2.10.0 HOT 9
- NVTabular KerasSequenceLoader costs longer time to load multi-hot features than one-hot features HOT 2
- [Question] OOM Is there a way not to load the whole dataset in the dataloader? HOT 1
- Shuffle doesn't work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataloader.