Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dennis182 opened this issue Apr 27, 2020 · 3 comments
Open

Comments

@Dennis182
Copy link

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
@neheller
Copy link
Owner

Interesting... this is the first I've heard of an issue like this. Some of the files are rather large. How much RAM does your system have?

@ELKYang
Copy link

ELKYang commented Jan 7, 2021

Hello, I also met this problem, how do you solve it?

@ELKYang
Copy link

ELKYang commented Jan 7, 2021

I have solved it
Change the python interpreter to anaconda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants