-
Notifications
You must be signed in to change notification settings - Fork 314
MemoryError #224
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
Comments
That is really interesting... Do you have a stack trace? |
Hello, thank you so much for getting back! This is the code. I'm trying to read a waveform file which is very huge. When I tried to set sampto = 50500000, I can read the file. But, I need the entire data file. This is the code: Error trace: MemoryError Traceback (most recent call last) ~/anaconda3/envs/python3/lib/python3.6/site-packages/wfdb/io/record.py in rdsamp(record_name, sampfrom, sampto, channels, pb_dir, channel_names, warn_empty) ~/anaconda3/envs/python3/lib/python3.6/site-packages/wfdb/io/record.py in rdrecord(record_name, sampfrom, sampto, channels, physical, pb_dir, m2s, smooth_frames, ignore_skew, return_res, force_channels, channel_names, warn_empty) ~/anaconda3/envs/python3/lib/python3.6/site-packages/wfdb/io/record.py in rdrecord(record_name, sampfrom, sampto, channels, physical, pb_dir, m2s, smooth_frames, ignore_skew, return_res, force_channels, channel_names, warn_empty) ~/anaconda3/envs/python3/lib/python3.6/site-packages/wfdb/io/_signal.py in dac(self, expanded, return_res, inplace) MemoryError: |
Hey @venkatesh71097, I ran this locally and it crashed like yours did on the first try then I closed out a lot of programs and got it to run successfully though it was a wild ride! I first ran this command: |
Hey lucas! Thank you so much! I am running on AWS, and I still get this error even after shutting down every other running thing. As you said, I can remove a few headers from the files and run them, but this error pops up in many other files as well. I'm running my code to read signals of one particular channel name on the MIMIC matched subset data (appx. 10,300 files). Can there be some way out to solve this memory error, like say, an option for precision (int/float/ as in MATLAB's WFDB), an option for downsampling the signal etc.? I am wondering if there's a way to bypass the files which entangle into MemoryError in the worst case (which I actually don't want to, as it might deprive me of important files), or stop recording samples before it encounters the memory error. To give you a basic background of what I'm doing, I've classified the patients based on one particular disease using the icd9_code in metadata, and am running the entire dataset over this. I couldn't map the seq_num (in diagnoses_icd) to the segment number in the matched subset data as they don't match. If required, I can give more details via personal conversation. Thanks in advance! |
Hey @venkatesh71097, good idea! I was thinking this too since I think it's running at |
Hey lucas! Thank you so much. It'll be a big breakthrough for my research if this is sorted as soon as possible. I had been struggling with this issue over the weekend, that some files get stuck in rdrecord, and some get stuck in rdsamp. Thanks again! :) |
Wow, awesome! Thank you so much lucas! :) |
Hey Lucas! There's one more follow-up issue for the same. For one more file, p000109, I tried reading and plotting the data from one channel, 'PLETH'. I was able to read this file once I made it read only the channel_name 'PLETH' (For many other files, as we discussed before, I'm not able to read even if I try to read only for 'PLETH' channel). But, I'm not able to plot as I'm again running into memory error. PFA the code and trace. But anyways, plotting is not very much required for my usecase, but it helps in visualizing the data. Just thought of reporting this to you as it might help others as well. Code: signal, fields = wfdb.rdsamp('../../physionet.org/files/mimic3wdb-matched/1.0/p00/p000109/p000109-2141-10-21-02-00', channel_names = ['PLETH']) Trace:MemoryError Traceback (most recent call last) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/pyplot.py in plot(scalex, scaley, data, *args, **kwargs) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/init.py in inner(ax, data, *args, **kwargs) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in plot(self, scalex, scaley, *args, **kwargs) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/axes/_base.py in add_line(self, line) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/axes/_base.py in _update_line_limits(self, line) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/lines.py in get_path(self) ~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/lines.py in recache(self, always) ~/anaconda3/envs/python3/lib/python3.6/site-packages/numpy/lib/shape_base.py in column_stack(tup) MemoryError: |
Hey @venkatesh71097! That seems like an issue with |
Hey lucas, sure! I'll plot using smaller distributions. That must be okay. Do let me know once the datatype option has been included in the repo! Thanks in advance! :) |
Hey @venkatesh71097! Some preliminary results here (and I think you'll like them)! Over half the time!! Pull request coming soon! |
Hey! Thank you so much. Great that you're taking computation time into consideration as it's currently taking a lot of time to process the data. Like, it took a few hours to read through certain files present in my local drive. If you could reduce the time consumption even more, that would be something really really great! |
While I'm trying to read waveform data using rdsamp / rdrecord, I encounter this 'MemoryError' issue many a times. I'm using Python 64 bit and am clueless on how to solve it. Any leads?
The text was updated successfully, but these errors were encountered: