When setting up the nilearn development environment according to the instructions, the process fails when I run the tests using:
pytest nilearn
Here’s the essence of the error:
E ValueError: Memory profiler measured an untrustable memory consumption (0.00 MiB). The expected memory limit was 100.00 MiB. Try to bench with larger objects (at least 100MiB in memory).
So far, I haven’t found a way to ‘bench with larger objects’.
Any suggestions?
Hi, I had a look but could not reproduce the error. It may be related to the specific operating system and/or special configurations of your machine. Can you provide some information about your operating system?
I am running:
Operating System: Ubuntu 20.04.4 LTS
Kernel: Linux 5.13.0-40-generic
Architecture: x86-64
Thanks for reporting ! The issue happens in this test:
which is basically creating an object of size 200 MiB and trying to assert that the memory used is less than 100 MiB, in order to verify that this error is correctly raised:
In your case, for some reason, the computed memory used (men_used ) seems to be smaller than 50 MiB, which is triggering this error instead:
I don’t know yet why you get this result and I cannot reproduce the bug on my machine (M1 chip macOS Monterey 12.2.1, python 3.9.12).
One quick and dirty way to get rid of this error is to uninstall memory_profiler, which will skip this test.
Otherwise, I’d be curious to know what value of mem_used you have. You can add a breakpoint() above line 97 above and run pytest -v nilearn/tests/test_testing.py.
Hope this helps a little bit, and please let me know how it goes!
Best,
Nicolas