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

ECG_detector_wrapper.py error on TUH dataset entries #5

Open
borisbaldassari opened this issue Sep 22, 2021 · 0 comments
Open

ECG_detector_wrapper.py error on TUH dataset entries #5

borisbaldassari opened this issue Sep 22, 2021 · 0 comments

Comments

@borisbaldassari
Copy link
Contributor

borisbaldassari commented Sep 22, 2021

Using ECG_detector_wrapper.py at 20e24c5 on the TUH - TUSZ/dev dataset.

The script works well (on hundreds of files) until it hits dev/03_tcp_ar_a/022/00002297/s003_2007_10_23/00002297_s003_t000.edf. Other files fail as well, with the same error.

Statistics:

  • 367 files Fail
  • 945 files OK

Error is

(env) $ python3 ECG_detector_wrapper.py --i TUH/v1.5.2/edf/dev/03_tcp_ar_a/022/00002297/s003_2007_10_23/00002297_s003_t000.edf -o test.json
Traceback (most recent call last):
  File "ECG_detector_wrapper.py", line 192, in <module>
    raise ValueError("Invalid ECG channels - " + str(n_ecg_channels))
ValueError: Invalid ECG channels - 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ECG_detector_wrapper.py", line 258, in <module>
    json.dump({"error": e} , open(output_filename, "w"))
  File "/usr/lib/python3.7/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ValueError is not JSON serializable
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

1 participant