Skip to content

.h5 data load in mri_3d example #31

@jonbmartin

Description

@jonbmartin

When running examples/demo_3d.ipynb on Ubuntu system with GPU, CUDA 11.8, Python 3.10, x86_64 architecture I run into an issue using h5py to load the .h5 data for the example. I don't encounter on my local system when running things on CPU. May relate to h5py/h5py#817.


ValueError Traceback (most recent call last)
Cell In[15], line 12
10 device0 = torch.device('cuda:0')
11 # Load Non-cartesian k-space trajectory, [nbatch (1), ndimension, nshot, nreadout]
---> 12 ktraj = torch.tensor(hf['ktraj'][()], dtype=torch.double).unsqueeze(0).to(device = device0, dtype = torch.float)
13 print('traj shape', ktraj.shape)
14 # Load k-space, [nbatch (1), ncoil, nshot, nreadout]

File h5py/_objects.pyx:54, in h5py._objects.with_phil.wrapper()

File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()

File ~/python_venvs/sheeprl/lib/python3.10/site-packages/h5py/_hl/dataset.py:781, in Dataset.getitem(self, args, new_dtype)
779 if self._fast_read_ok and (new_dtype is None):
780 try:
--> 781 return self._fast_reader.read(args)
782 except TypeError:
783 pass # Fall back to Python read pathway below

File ~/python_venvs/sheeprl/lib/python3.10/site-packages/h5py/_hl/dataset.py:551, in Dataset._fast_reader(self)
548 if '_fast_reader' in self._cache_props:
549 return self._cache_props['_fast_reader']
--> 551 rdr = _selector.Reader(self.id)
553 # If the file is read-only, cache the reader to speed up future uses.
554 # This cache is invalidated by .refresh() when using SWMR.
555 if self._readonly:

File h5py/_selector.pyx:320, in h5py._selector.Reader.cinit()

File h5py/h5t.pyx:1087, in h5py.h5t.TypeFloatID.py_dtype()

ValueError: Insufficient precision in available types to represent (63, 52, 11, 0, 52)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions