# data

**URL:** https://discuss.pytorch.org/c/data/37.md

[Latest](https://discuss.pytorch.org/latest.md) · [Categories](https://discuss.pytorch.org/categories.md)

---

## [About the data category](https://discuss.pytorch.org/t/about-the-data-category/138687)

<div class="topic-metadata">

**Author:** [@albanD](https://discuss.pytorch.org/u/albanD)\
**Replies:** 0

</div>

Topics related to DataLoader, Dataset, torch.utils.data, pytorch/data, and TorchArrow.

---

## [Training Data for Multi-Label Classification](https://discuss.pytorch.org/t/training-data-for-multi-label-classification/225326)

<div class="topic-metadata">

**Author:** [@Amber\_Drinkwater](https://discuss.pytorch.org/u/Amber_Drinkwater)\
**Replies:** 0\
**Last updated:** [August 25, 2026, 12:28pm UTC](https://discuss.pytorch.org/t/training-data-for-multi-label-classification/225326 "2026-08-25T12:28:43Z")

</div>

Hello! I am working on a model to label frequency and time domain data for Insertion Loss, Return Loss, Phase, and TDR. I need the model to take in this data and determine if it passes or fails, what the failure mode wa…

---

## [Patterns for making a long-running multimodal data loader more reliable?](https://discuss.pytorch.org/t/patterns-for-making-a-long-running-multimodal-data-loader-more-reliable/225309)

<div class="topic-metadata">

**Author:** [@Greta](https://discuss.pytorch.org/u/Greta)\
**Replies:** 0\
**Last updated:** [August 21, 2026, 2:58am UTC](https://discuss.pytorch.org/t/patterns-for-making-a-long-running-multimodal-data-loader-more-reliable/225309 "2026-08-21T02:58:25Z")

</div>

I’m working on a long-running pipeline that collects public image-text and video-text records before they are normalized for training. The model code is fairly straightforward, but the data loader needs to handle interm…

---

## [29.6x Less Checkpoint Work for PyTorch Model Saving — Exact Reload](https://discuss.pytorch.org/t/29-6x-less-checkpoint-work-for-pytorch-model-saving-exact-reload/225282)

<div class="topic-metadata">

**Author:** [@Michael\_Yang](https://discuss.pytorch.org/u/Michael_Yang)\
**Replies:** 0\
**Last updated:** [August 13, 2026, 12:45am UTC](https://discuss.pytorch.org/t/29-6x-less-checkpoint-work-for-pytorch-model-saving-exact-reload/225282 "2026-08-13T00:45:20Z")

</div>

29.6x Less Checkpoint Work for PyTorch Model Saving — Exact Reload I’ve been experimenting with a different way to handle persistent model checkpoints when only a small fraction of model state changes between versions. …

---

## [Editing data labels](https://discuss.pytorch.org/t/editing-data-labels/225258)

<div class="topic-metadata">

**Author:** [@Darhen](https://discuss.pytorch.org/u/Darhen)\
**Replies:** 2\
**Last updated:** [August 9, 2026, 6:25pm UTC](https://discuss.pytorch.org/t/editing-data-labels/225258 "2026-08-09T18:25:19Z")

</div>

Hello, I am trying to split Cifar10 to get two subsets (Animals and Vehicles). I was able to successfully separate them by the labels partitioner = IidPartitioner(num\_partitions=1) fds = FederatedDataset(dataset="uoft-…

---

## [New noise generation in DataLoader](https://discuss.pytorch.org/t/new-noise-generation-in-dataloader/224924)

<div class="topic-metadata">

**Author:** [@Enthusiast](https://discuss.pytorch.org/u/Enthusiast)\
**Replies:** 1\
**Last updated:** [June 16, 2026, 1:18am UTC](https://discuss.pytorch.org/t/new-noise-generation-in-dataloader/224924 "2026-06-16T01:18:57Z")

</div>

Hi, I’m building a denoising pipeline with a map-style Dataset and wrapper composition. I’d like some guidance on the best way to reliably get reproducible on-the-fly noise generation. Current setup Base Dataset retu…

---

## [Given groups=1, weight of size \[48, 32, 3, 3\], expected input\[1, 14, 128, 94\] to have 32 channels, but got 14 channels instead](https://discuss.pytorch.org/t/given-groups-1-weight-of-size-48-32-3-3-expected-input-1-14-128-94-to-have-32-channels-but-got-14-channels-instead/225021)

<div class="topic-metadata">

**Author:** [@JT4v4res](https://discuss.pytorch.org/u/JT4v4res)\
**Replies:** 3\
**Last updated:** [June 14, 2026, 3:42pm UTC](https://discuss.pytorch.org/t/given-groups-1-weight-of-size-48-32-3-3-expected-input-1-14-128-94-to-have-32-channels-but-got-14-channels-instead/225021 "2026-06-14T15:42:35Z")

</div>

Hey guys, I’ facing an issue regarding my dataloader itself. For some reason, one of the last entries in the dataset is having a channel size of 14 channels instead of the 32 channels. Could it be due to some issue on m…

---

## [Sanity-checking a first-pass input-bound vs compute-bound check for low GPU utilization](https://discuss.pytorch.org/t/sanity-checking-a-first-pass-input-bound-vs-compute-bound-check-for-low-gpu-utilization/225075)

<div class="topic-metadata">

**Author:** [@abhinavsriva](https://discuss.pytorch.org/u/abhinavsriva)\
**Replies:** 0\
**Last updated:** [June 10, 2026, 8:08pm UTC](https://discuss.pytorch.org/t/sanity-checking-a-first-pass-input-bound-vs-compute-bound-check-for-low-gpu-utilization/225075 "2026-06-10T20:08:37Z")

</div>

Sanity-checking a first-pass input-bound vs compute-bound check for low GPU utilization Hi all, Disclosure: I am working on TraceML, a small tracing tool for PyTorch training, and this question comes from that work. I a…

---

## [Is torchdata maintained?](https://discuss.pytorch.org/t/is-torchdata-maintained/225049)

<div class="topic-metadata">

**Author:** [@alexdremov](https://discuss.pytorch.org/u/alexdremov)\
**Replies:** 0\
**Last updated:** [June 6, 2026, 10:40am UTC](https://discuss.pytorch.org/t/is-torchdata-maintained/225049 "2026-06-06T10:40:41Z")

</div>

I see that the recent commits are quite old and issues/PRs not getting resolved. Is anyone still maintaining this project or we have to look for alternatives?

---

## [Unable to allocate shared memory(shm) for file](https://discuss.pytorch.org/t/unable-to-allocate-shared-memory-shm-for-file/224535)

<div class="topic-metadata">

**Author:** [@cosmosaa](https://discuss.pytorch.org/u/cosmosaa)\
**Replies:** 4\
**Last updated:** [February 18, 2026, 9:16pm UTC](https://discuss.pytorch.org/t/unable-to-allocate-shared-memory-shm-for-file/224535 "2026-02-18T21:16:54Z")

</div>

RuntimeError: unable to allocate shared memory(shm) for file \</torch\_206732\_4264974204\_15\>: Resource temporarily unavailable (11) I am not sure how to get around this issue. I do not have direct control over /dev/shm. i…

---

## [Efficient dataloadfer for sharded dataset](https://discuss.pytorch.org/t/efficient-dataloadfer-for-sharded-dataset/224447)

<div class="topic-metadata">

**Author:** [@Enthusiast](https://discuss.pytorch.org/u/Enthusiast)\
**Replies:** 2\
**Last updated:** [February 5, 2026, 12:40pm UTC](https://discuss.pytorch.org/t/efficient-dataloadfer-for-sharded-dataset/224447 "2026-02-05T12:40:40Z")

</div>

Hi, I have a bit of an issue thinking of a good design for efficiently loading in a sharded dataset. I’m struggling to map the way the data is laid out on disk onto the PyTorch Dataset/DataLoader abstractions that minim…

---

## [Exploding memory in torch.utils.data.DataLoader.\_\_getitem\_\_ when using polars dataframes](https://discuss.pytorch.org/t/exploding-memory-in-torch-utils-data-dataloader-getitem-when-using-polars-dataframes/224448)

<div class="topic-metadata">

**Author:** [@J0wsper](https://discuss.pytorch.org/u/J0wsper)\
**Replies:** 0\
**Last updated:** [January 30, 2026, 7:48pm UTC](https://discuss.pytorch.org/t/exploding-memory-in-torch-utils-data-dataloader-getitem-when-using-polars-dataframes/224448 "2026-01-30T19:48:34Z")

</div>

hi, I have been having a continual problem with the \_\_getitem\_\_ method for DataLoaders for a specific use case. I am trying to do image segmentation on greyscale images. I have my images stored as .parquet files and my …

---

## [Best practices for network bottlenecked image data loading + transforms](https://discuss.pytorch.org/t/best-practices-for-network-bottlenecked-image-data-loading-transforms/224356)

<div class="topic-metadata">

**Author:** [@layman](https://discuss.pytorch.org/u/layman)\
**Replies:** 2\
**Last updated:** [January 23, 2026, 11:27pm UTC](https://discuss.pytorch.org/t/best-practices-for-network-bottlenecked-image-data-loading-transforms/224356 "2026-01-23T23:27:43Z")

</div>

I am loading my image data in a way where I do download and transform under the same Dataset fetch call: class MyImageSet(Dataset): ... def \_\_getitem\_\_(self, idx): file\_key = self.file\_keys\[idx\] …

---

## [Efficient dataloader for pathology whole slide images](https://discuss.pytorch.org/t/efficient-dataloader-for-pathology-whole-slide-images/223037)

<div class="topic-metadata">

**Author:** [@lely475](https://discuss.pytorch.org/u/lely475)\
**Replies:** 2\
**Last updated:** [January 14, 2026, 6:56pm UTC](https://discuss.pytorch.org/t/efficient-dataloader-for-pathology-whole-slide-images/223037 "2026-01-14T18:56:06Z")

</div>

I’m working with pathology WSIs (very large, e.g., 100,000×100,000 px), split into tiles (224×224 RGB). Each WSI can have 500–15,000 tiles. Labels are only at the WSI level, so I need a DataLoader that: Samples a subs…

---

## [How to implement dynamic or cost-aware data prefetching logic using pytorch dataloader?](https://discuss.pytorch.org/t/how-to-implement-dynamic-or-cost-aware-data-prefetching-logic-using-pytorch-dataloader/224302)

<div class="topic-metadata">

**Author:** [@Ptuser400](https://discuss.pytorch.org/u/Ptuser400)\
**Replies:** 1\
**Last updated:** [January 9, 2026, 4:51pm UTC](https://discuss.pytorch.org/t/how-to-implement-dynamic-or-cost-aware-data-prefetching-logic-using-pytorch-dataloader/224302 "2026-01-09T16:51:10Z")

</div>

I am pretty new to pytorch, but was just wondering if it is possible to implement cost-aware data prefetching in pytorch for maximum gpu utilization. I.e. not just statically populating prefetch\_factor but rather making …

---

## [An "adaptable" image dataset loader?](https://discuss.pytorch.org/t/an-adaptable-image-dataset-loader/224261)

<div class="topic-metadata">

**Author:** [@LmanTW](https://discuss.pytorch.org/u/LmanTW)\
**Replies:** 4\
**Last updated:** [December 31, 2025, 11:11am UTC](https://discuss.pytorch.org/t/an-adaptable-image-dataset-loader/224261 "2025-12-31T11:11:36Z")

</div>

Hello to the PyTorch community! Context I’m building a tool for training vision models, the main focus of the tool is to make everything “just works”. An easy to use CLI binary you can use to inference and train models,…

---

## [How to transfer data in automatically with DataLoader and Dataset](https://discuss.pytorch.org/t/how-to-transfer-data-in-automatically-with-dataloader-and-dataset/224216)

<div class="topic-metadata">

**Author:** [@briedel](https://discuss.pytorch.org/u/briedel)\
**Replies:** 3\
**Last updated:** [December 30, 2025, 10:05pm UTC](https://discuss.pytorch.org/t/how-to-transfer-data-in-automatically-with-dataloader-and-dataset/224216 "2025-12-30T22:05:12Z")

</div>

Hi, I have a bit of conundrum with data movement and the assumptions inside DataLoader and Dataset that I am not sure how to solve. My data is located in storage cluster located at X. My GPUs are in a cluster at Y. The…

---

## [How to implement a custom distributed sampler](https://discuss.pytorch.org/t/how-to-implement-a-custom-distributed-sampler/151349)

<div class="topic-metadata">

**Author:** [@mk6](https://discuss.pytorch.org/u/mk6)\
**Replies:** 5\
**Last updated:** [December 21, 2025, 4:04pm UTC](https://discuss.pytorch.org/t/how-to-implement-a-custom-distributed-sampler/151349 "2025-12-21T16:04:14Z")

</div>

Hi, I’m working on sequence data and would like to group sequences of similar lengths into batches. Here is an example implementation (source) """ To group the texts with similar length together, like introduced in the…

---

## [DataLoader higher number of workers and prefetch factor is worse than num\_workers=0 and prefetch\_factor=0](https://discuss.pytorch.org/t/dataloader-higher-number-of-workers-and-prefetch-factor-is-worse-than-num-workers-0-and-prefetch-factor-0/222943)

<div class="topic-metadata">

**Author:** [@soral](https://discuss.pytorch.org/u/soral)\
**Replies:** 1\
**Last updated:** [December 2, 2025, 11:31am UTC](https://discuss.pytorch.org/t/dataloader-higher-number-of-workers-and-prefetch-factor-is-worse-than-num-workers-0-and-prefetch-factor-0/222943 "2025-12-02T11:31:50Z")

</div>

I am training a ResNet50 from scratch using ImageNet-1k using DDP and torchrun on an HPC cluster. I use a single node with 4 Tesla V100 GPUs and 2 Intel Xeon CPUs (28 cores in total). I roughly followed the PyTorch refer…

---

## [Discrepancy between number of edges in batched samples and single sample in Pytroch Geometric](https://discuss.pytorch.org/t/discrepancy-between-number-of-edges-in-batched-samples-and-single-sample-in-pytroch-geometric/223947)

<div class="topic-metadata">

**Author:** [@Levente\_Sipos](https://discuss.pytorch.org/u/Levente_Sipos)\
**Replies:** 0\
**Last updated:** [November 14, 2025, 8:49pm UTC](https://discuss.pytorch.org/t/discrepancy-between-number-of-edges-in-batched-samples-and-single-sample-in-pytroch-geometric/223947 "2025-11-14T20:49:01Z")

</div>

Hi, I’m having difficulties with seeing why batched graphs have a different number of edges than they should. I am using the NeuroGraphDataset and trying to train a graph diffusion model. In this dataset there 400 nodes …

---

## [Downscale Image Dataset](https://discuss.pytorch.org/t/downscale-image-dataset/223810)

<div class="topic-metadata">

**Author:** [@arimaa](https://discuss.pytorch.org/u/arimaa)\
**Replies:** 0\
**Last updated:** [November 4, 2025, 11:39pm UTC](https://discuss.pytorch.org/t/downscale-image-dataset/223810 "2025-11-04T23:39:24Z")

</div>

Hi, I have an image dataset and I want to downscale them but the images lose the quality. Do you know the methods or models to improve the problem? I have tried the interpolation methods with resize, but the output is no…

---

## [Avoiding overfitting to public leaderboard on kaggle competition](https://discuss.pytorch.org/t/avoiding-overfitting-to-public-leaderboard-on-kaggle-competition/223753)

<div class="topic-metadata">

**Author:** [@mehdiamlal](https://discuss.pytorch.org/u/mehdiamlal)\
**Replies:** 0\
**Last updated:** [October 29, 2025, 9:46pm UTC](https://discuss.pytorch.org/t/avoiding-overfitting-to-public-leaderboard-on-kaggle-competition/223753 "2025-10-29T21:46:14Z")

</div>

I am partecipating to my first Kaggle competition, my team and I are currently first but we want to avoid overfitting to the public leaderboard, as we know that in these competitions it is very common to do it, ending up…

---

## [Support for NVIDIA RTX 5090 (CUDA SM\_120)](https://discuss.pytorch.org/t/support-for-nvidia-rtx-5090-cuda-sm-120/223683)

<div class="topic-metadata">

**Author:** [@bartwojtas](https://discuss.pytorch.org/u/bartwojtas)\
**Replies:** 1\
**Last updated:** [October 23, 2025, 1:08pm UTC](https://discuss.pytorch.org/t/support-for-nvidia-rtx-5090-cuda-sm-120/223683 "2025-10-23T13:08:59Z")

</div>

Hi, I’ve recently tested PyTorch (nightly build with CUDA 12.1) on an NVIDIA RTX 5090 and received a warning: “sm\_120 is not supported” Will support for sm\_120 be included in upcoming builds? GPU: RTX 5090 Driver: 5…

---

## ["Suggested max num workers is 2" but I have 96 cores?](https://discuss.pytorch.org/t/suggested-max-num-workers-is-2-but-i-have-96-cores/170344)

<div class="topic-metadata">

**Author:** [@drscotthawley](https://discuss.pytorch.org/u/drscotthawley)\
**Replies:** 5\
**Last updated:** [October 16, 2025, 8:12pm UTC](https://discuss.pytorch.org/t/suggested-max-num-workers-is-2-but-i-have-96-cores/170344 "2025-10-16T20:12:01Z")

</div>

Hi, I’m confused. I’ve got 96 CPUs with 2 threads each. I chose num\_workers=12 for my DataLoader but I’m getting a warning: UserWarning: This DataLoader will create 12 worker processes in total. Our suggested max numb…

---

## [torch.cuda.set\_per\_process\_memory\_fraction() doesn’t see shared memory](https://discuss.pytorch.org/t/torch-cuda-set-per-process-memory-fraction-doesn-t-see-shared-memory/223336)

<div class="topic-metadata">

**Author:** [@elismasilva](https://discuss.pytorch.org/u/elismasilva)\
**Replies:** 3\
**Last updated:** [September 26, 2025, 10:40pm UTC](https://discuss.pytorch.org/t/torch-cuda-set-per-process-memory-fraction-doesn-t-see-shared-memory/223336 "2025-09-26T22:40:27Z")

</div>

torch.cuda.set\_per\_process\_memory\_fraction() doesn’t see shared memory. I have a GPU with 8GB of video memory. I’m running a model that consumes my 8GB and overflows another 8GB into Windows’ shared video memory. When I …

---

## [Will DataLoader deallocate the CPU memory after one batch training?](https://discuss.pytorch.org/t/will-dataloader-deallocate-the-cpu-memory-after-one-batch-training/223059)

<div class="topic-metadata">

**Author:** [@Zoe\_Zhao](https://discuss.pytorch.org/u/Zoe_Zhao)\
**Replies:** 1\
**Last updated:** [September 14, 2025, 9:05am UTC](https://discuss.pytorch.org/t/will-dataloader-deallocate-the-cpu-memory-after-one-batch-training/223059 "2025-09-14T09:05:59Z")

</div>

Hi! For my experience, when training a Dataset with Pytorch, the CPU occupied memory will keep stable. Is that because the DataLoader automatically deallocates the CPU memory occupied by the previous batch of torch tens…

---

## [Extremely Imbalanced Data](https://discuss.pytorch.org/t/extremely-imbalanced-data/223065)

<div class="topic-metadata">

**Author:** [@mmf](https://discuss.pytorch.org/u/mmf)\
**Replies:** 7\
**Last updated:** [September 13, 2025, 5:04pm UTC](https://discuss.pytorch.org/t/extremely-imbalanced-data/223065 "2025-09-13T17:04:57Z")

</div>

Hi, everyone. I’m struggling with a very challenging issue. I have a binary database of 500K images. Of those 500K, only 10K are from one class and the rest are from a different class. I can’t use synthetic data. I’m us…

---

## [Aborted in smolvla start offline training](https://discuss.pytorch.org/t/aborted-in-smolvla-start-offline-training/222933)

<div class="topic-metadata">

**Author:** [@cyc](https://discuss.pytorch.org/u/cyc)\
**Replies:** 1\
**Last updated:** [September 8, 2025, 6:29pm UTC](https://discuss.pytorch.org/t/aborted-in-smolvla-start-offline-training/222933 "2025-09-08T18:29:14Z")

</div>

I encountered a problem. When I started training with the smolvla model, it aborted. The following is the error message environment： ubuntu：22.04 memory：128G GPU：RTX5090 48G CUDA12.8 pytorch：2.9.0.dev20250904+cu128 …

---

## [StatefulDataLoader restore error for RNG must be a torch.ByteTensor](https://discuss.pytorch.org/t/statefuldataloader-restore-error-for-rng-must-be-a-torch-bytetensor/221998)

<div class="topic-metadata">

**Author:** [@Ling\_Xue](https://discuss.pytorch.org/u/Ling_Xue)\
**Replies:** 1\
**Last updated:** [August 29, 2025, 9:59pm UTC](https://discuss.pytorch.org/t/statefuldataloader-restore-error-for-rng-must-be-a-torch-bytetensor/221998 "2025-08-29T21:59:19Z")

</div>

I save the dataloader as from torchdata.stateful\_dataloader import StatefulDataLoader train\_dataloader = StatefulDataLoader( train\_dataset, batch\_size=args.micro\_train\_batch\_size, sa…

---

## [Efficient dataset saving/loading for large PyG graphs (8000 patients or more)](https://discuss.pytorch.org/t/efficient-dataset-saving-loading-for-large-pyg-graphs-8000-patients-or-more/222187)

<div class="topic-metadata">

**Author:** [@hadrien\_calmet](https://discuss.pytorch.org/u/hadrien_calmet)\
**Replies:** 1\
**Last updated:** [August 21, 2025, 9:37am UTC](https://discuss.pytorch.org/t/efficient-dataset-saving-loading-for-large-pyg-graphs-8000-patients-or-more/222187 "2025-08-21T09:37:56Z")

</div>

Hi everyone I am building a large torch\_geometric dataset with ~8,000 object(.pt) , are patients in my case. Each patient contains several tensors, producing a Data object (node features, edge indices, and a single tar…

[Next page](https://discuss.pytorch.org/c/data/37.md?page=1)
