NVIDIA / NVIDIA/DALI

Can DALI read from HDF5 file?

Open
#1,252 3 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement external contribution welcome
Dominant language
C++
Stars
5.8k
Forks
678
Avg merge
3d 1h
Merged PRs (30d)
27

Description

Hi,
I would like to read images from pre-saved HDF5 file? With pytorch dataloader, e.g. I create the following data class and put it in dataloader.

class H5Dataset(Dataset):
    def __init__(self, h5_path):
        self.h5_path = h5_path
        self.h5_file = h5py.File(h5_path, 'r')
        self.length = len(h5py.File(h5_path, 'r'))
    
    def __getitem__(self, index):
        record = self.h5_file[str(index)]
        return (
            record['data'].value,
            record['target'].value,
        )
        
    def __len__(self):
        return self.length

Is it possible to use DALI to read HDF5, will it be faster than pytorch dataloader?

Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No project file, test, or entry point is named. Start by locating DALI's existing input operators and data-format coverage, then establish whether HDF5 reading is supported and how it compares with the shown PyTorch DataLoader; done requires a clear answer or an explicitly scoped implementation request.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
data, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.