physhik / ecg-mit-bih

ECG classification using MIT-BIH data, a deep CNN learning implementation of Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network, https://www.nature.com/articles/s41591-018-0268-3 and also deploy the trained model to a web app using Flask, introduced at
https://physhik.github.io/2019/03/machine-learns-from-cardiologist-3/
GNU General Public License v3.0
183 stars 60 forks source link

train.hdf5 without error, test.hdf5 comes with error #12

Open ttkrpink opened 2 years ago

ttkrpink commented 2 years ago

Python 3.6.8, numpy 1.16.0 Other files are the same.

data.py with train set works fine. It seems the test set has the following error.

100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [30:42<00:00, 48.46s/it] 12%|████████████████▉ | 1/8 [00:42<04:55, 42.26s/it]Traceback (most recent call last):█████████████████████████████████████████████████████████████████████████████████████████████████████| 3626/3626 [00:42<00:00, 47.51it/s] File "src/data.py", line 136, in main(config) File "src/data.py", line 132, in main return preprocess(config.split) File "src/data.py", line 114, in preprocess dataSaver(testset, 'dataset/test.hdf5', 'dataset/testlabel.hdf5') File "src/data.py", line 92, in dataSaver dataprocess() File "src/data.py", line 60, in dataprocess record = rdrecord('dataset/'+ num, smooth_frames= True) File "F:\PyThon\virtual\36\lib\site-packages\wfdb\io\record.py", line 1232, in rdrecord ignore_skew) File "F:\PyThon\virtual\36\lib\site-packages\wfdb\io_signal.py", line 876, in _rd_segment smooth_frames)[:, r_w_channel[fn]] File "F:\PyThon\virtual\36\lib\site-packages\wfdb\io_signal.py", line 974, in _rd_dat_signals sig_data = _blocks_to_samples(sig_data, total_process_samples, fmt) File "F:\PyThon\virtual\36\lib\site-packages\wfdb\io_signal.py", line 1269, in _blocks_to_samples sig[0::2] = sig_data[0::3] + 256 * np.bitwise_and(sig_data[1::3], 0x0f) ValueError: could not broadcast input array from shape (283885) into shape (650000) Exception ignored in: <bound method tqdm.del of 12%|████████████████▉ | 1/8 [00:42<04:55, 42.26s/it]> Traceback (most recent call last): File "F:\PyThon\virtual\36\lib\site-packages\tqdm_tqdm.py", line 931, in del self.close() File "F:\PyThon\virtual\36\lib\site-packages\tqdm_tqdm.py", line 1133, in close self._decr_instances(self) File "F:\PyThon\virtual\36\lib\site-packages\tqdm_tqdm.py", line 496, in _decr_instances cls.monitor.exit() File "F:\PyThon\virtual\36\lib\site-packages\tqdm_monitor.py", line 52, in exit self.join() File "F:\PyThon\3.6.8\lib\threading.py", line 1053, in join raise RuntimeError("cannot join current thread") RuntimeError: cannot join current thread

wkzqn commented 2 years ago

谢谢。您的邮件已收到,我会尽快处理。

Shasmita commented 1 year ago

Were you able to solve the above issue and run the application successfully?

wkzqn commented 1 year ago

谢谢。您的邮件已收到,我会尽快处理。

sg4395 commented 1 year ago

Hi were you able to work this out?

physhik commented 1 year ago

I have never experienced such an error before. I will check out

sg4395 commented 1 year ago

Thank you, please let me know!

Best, ASEAN

Get Outlook for iOShttps://aka.ms/o0ukef


From: Namshik Kim @.> Sent: Thursday, February 9, 2023 8:00:51 AM To: physhik/ecg-mit-bih @.> Cc: sg4395 @.>; Comment @.> Subject: Re: [physhik/ecg-mit-bih] train.hdf5 without error, test.hdf5 comes with error (Issue #12)

I have never experienced such an error before. I will check out

— Reply to this email directly, view it on GitHubhttps://github.com/physhik/ecg-mit-bih/issues/12#issuecomment-1423394998, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATGH7BESNKZ7NSXFYXDNB5DWWQXTHANCNFSM5RD7EHKA. You are receiving this because you commented.Message ID: @.***>

sg4395 commented 1 year ago

Hi Namshik,

Were you able to take a look at the code and see if it runs? I think maybe the hdf5 file isn't being created for some reason. App.py encounters similar issue. By the way do you know if app.py requires the data to be 300+hz like the data you trained the model with? Or does it take any sampling rate data ?

Best, Sean

Get Outlook for iOShttps://aka.ms/o0ukef


From: Sean Guo @.> Sent: Friday, February 10, 2023 4:24:40 AM To: physhik/ecg-mit-bih @.>; physhik/ecg-mit-bih @.> Cc: Comment @.> Subject: Re: [physhik/ecg-mit-bih] train.hdf5 without error, test.hdf5 comes with error (Issue #12)

Thank you, please let me know!

Best, ASEAN

Get Outlook for iOShttps://aka.ms/o0ukef


From: Namshik Kim @.> Sent: Thursday, February 9, 2023 8:00:51 AM To: physhik/ecg-mit-bih @.> Cc: sg4395 @.>; Comment @.> Subject: Re: [physhik/ecg-mit-bih] train.hdf5 without error, test.hdf5 comes with error (Issue #12)

I have never experienced such an error before. I will check out

— Reply to this email directly, view it on GitHubhttps://github.com/physhik/ecg-mit-bih/issues/12#issuecomment-1423394998, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATGH7BESNKZ7NSXFYXDNB5DWWQXTHANCNFSM5RD7EHKA. You are receiving this because you commented.Message ID: @.***>

sg4395 commented 1 year ago

I have never experienced such an error before. I will check out

Hi Namshik, were you able to get it working?