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

ModuleNotFoundError: No module named 'sklearn.svm.classes' #11

Closed
morisbagic opened this issue Oct 26, 2022 · 4 comments
Closed

ModuleNotFoundError: No module named 'sklearn.svm.classes' #11

morisbagic opened this issue Oct 26, 2022 · 4 comments

Comments

@morisbagic
Copy link

Hello,

I am working from macos M1 and it has been really hard for me to set up the environment.
I have tried creating environment from .yml file but got "Solving environment: failed" message. I have created new environment, installed numpy (because it wasn't working properly otherwise) and then updated environment from requirements.txt. I have then installed wfdb software package. While running the example script it gives me the error:

ModuleNotFoundError: No module named 'sklearn.svm.classes'

I would really appreciate if you could help me.
If you need any extra info, please let me know.

@tomas-teijeiro
Copy link
Contributor

Hello,

I'm sorry you are having trouble with the environment. We have recently updated the .yml file to avoid cross-platform issues, so please try to install it again. Otherwise, to avoid the mentioned problem you should install a version of scikit-learn <= 0.22.1.

Please let me know if this worked for you.

@morisbagic
Copy link
Author

You suggestion has been helpful.

I have built new conda environment, installed python=3.8, cython=0.28.5 to be able to install scikit-learn=0.22.1. Afterwards did conda env update from environment.yml and then compiled "construe.utils.signal_processing.dtw package" as you suggested in Known Issues. I have successfully managed to run run_example.sh!

I have also installed wfdb software package but I think I have done something wrong because when I run "python3 construe_ecg.py -r 100" it returnes:

init: can't open header for record 100
Traceback (most recent call last):
File "construe_ecg.py", line 123, in
set_ADCGain(get_gain(args.r))
File "./Desktop/construe-public/construe/utils/MIT/record_reader.py", line 53, in get_gain
for s in check_output(['wfdbdesc', record_path]).splitlines()]
File "./opt/miniconda3/envs/construe/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "./opt/miniconda3/envs/construe/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['wfdbdesc', '100']' returned non-zero exit status 2.

Hope that you can help me with that and thank you for your respond.

@tomas-teijeiro
Copy link
Contributor

Hello,

It seems the problem is that the WFDB software is not able to read the record named '100'. The simplest solution is to copy the record (.hea and .dat files) to the same folder where you are running the script. Another solution is to modify the WFDB environment variable to point to the folder where the records are saved.

@morisbagic
Copy link
Author

morisbagic commented Nov 3, 2022

Thank you for the answer. I have successfully resolved this issue regarding the installation process! Now, I had tried to load my signal using wrsamp function to get .hea and .dat files, I have set the sampling frequency and multiplied the signal and error I get is:

File "construe_ecg.py", line 162, in
result = process_record_rhythm(rname, annots, args.tfactor,
File "./Desktop/Python/EKG_projekt/construe-public/record_processing.py", line 424, in process_record_rhythm
IN.set_record(path, ann)
File "./Desktop/Python/EKG_projekt/construe-public/construe/acquisition/record_acquisition.py", line 51, in set_record
_REC = load_MIT_record(record, physical_units)
File "./Desktop/Python/EKG_projekt/construe-public/construe/utils/MIT/record_reader.py", line 98, in load_MIT_record
raise ValueError('None of the signals in the {0} record is '
ValueError: None of the signals in the dataOut record is recognizable as an ECG signal

I manage to load the record and plot the signal, still it unrecognizible to this app, do you have any suggestions?

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

2 participants