Skip to content

MemoryError at get_data (memory is available according to Task Manager) #56

@Dennis182

Description

@Dennis182

Hi, thanks for providing the data.
Does the following error affect several users or does it only occur with me? Even if I change the function call as recommended, I get the MemoryError.
.../kits19/starter_code/visualize.py:81: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

  • deprecated from version: 3.0
  • Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
    vol = vol.get_data()
    Traceback (most recent call last):
    File ".../kits19/starter_code/visualize.py", line 155, in
    visualize("case_00000", r"C:\Users\User\GIT\kits19\dataoutput")
    File ".../kits19/starter_code/visualize.py", line 81, in visualize
    vol = vol.get_data()
    File "...\kits19\venv37\lib\site-packages\nibabel\deprecator.py", line 162, in deprecated_func
    return func(*args, **kwargs)
    File "...\kits19\venv37\lib\site-packages\nibabel\dataobj_images.py", line 207, in get_data
    data = np.asanyarray(self._dataobj)
    File "...\kits19\venv37\lib\site-packages\numpy\core_asarray.py", line 138, in asanyarray
    return array(a, dtype, copy=False, order=order, subok=True)
    File "...\kits19\venv37\lib\site-packages\nibabel\arrayproxy.py", line 391, in array
    arr = self._get_scaled(dtype=dtype, slicer=())
    File "...\kits19\venv37\lib\site-packages\nibabel\arrayproxy.py", line 358, in _get_scaled
    scaled = apply_read_scaling(self._get_unscaled(slicer=slicer), scl_slope, scl_inter)
    File "..\kits19\venv37\lib\site-packages\nibabel\arrayproxy.py", line 337, in _get_unscaled
    mmap=self._mmap)
    File "...\kits19\venv37\lib\site-packages\nibabel\volumeutils.py", line 522, in array_from_file
    data_bytes = bytearray(n_bytes)
    MemoryError

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