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

ValueError: CV (1) cannot be larger than number of subjects (0) #63

Open
kun2001github opened this issue Apr 7, 2024 · 1 comment
Open

Comments

@kun2001github
Copy link

Hello Mr Perslev, When I tried to reproduce, I encountered the following error while running the data set segmentation:

(u-sleep) C:\Users\xxa\Desktop\U-Time-main\U-Time-main>ut cv_split --data_dir data/dcsm/ --subject_dir_pattern 'tp*'  --CV 1  --validation_fraction 0.10 --test_fraction 0.25  --seed 123

2024/04/07 19:06:09 | INFO | Entry script args dump: {'script': 'cv_split', 'project_dir': './', 'log_dir': 'logs', 'log_level': 'INFO', 'seed': 123}

2024/04/07 19:06:09 | INFO | Project directory set: C:\Users\xxa\Desktop\U-Time-main\U-Time-main (initialized project: False)

2024/04/07 19:06:10 | INFO | Seeding TensorFlow, numpy and random modules with seed: 123

2024/04/07 19:06:11 | INFO | Logs will not be saved to file for these loggers: [<Logger utime (INFO)>, <Logger psg_utils (INFO)>] (--log_file_name is empty)

2024/04/07 19:06:11 | INFO | Creating directory at C:\Users\xxa\Desktop\U-Time-main\U-Time-main\data\dcsm\views\fixed_split
Traceback (most recent call last):
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\Scripts\ut-script.py", line 33, in <module>
    sys.exit(load_entry_point('utime==1.1.8', 'console_scripts', 'ut')())
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\lib\site-packages\utime-1.1.8-py3.7.egg\utime\bin\ut.py", line 103, in entry_func
    mod.entry_func(script_args + help_agrs)
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\lib\site-packages\utime-1.1.8-py3.7.egg\utime\bin\cv_split.py", line 404, in entry_func
    run(args)
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\lib\site-packages\utime-1.1.8-py3.7.egg\utime\bin\cv_split.py", line 336, in run
    raise ValueError(f"CV ({n_splits}) cannot be larger than number of "
ValueError: CV (1) cannot be larger than number of subjects (0)
———————————————————————————————————————————————————————
(u-sleep) C:\Users\xxa\Desktop\U-Time-main\U-Time-main>ut cv_split --data_dir data/sedf_sc/  --subject_dir_pattern 'SC*'  --CV 1 --validation_fraction 0.10 --test_fraction 0.25 --subject_matching_regex 'SC4(\d{2}).*'   --seed 123

2024/04/07 19:05:57 | INFO | Entry script args dump: {'script': 'cv_split', 'project_dir': './', 'log_dir': 'logs', 'log_level': 'INFO', 'seed': 123}

2024/04/07 19:05:57 | INFO | Project directory set: C:\Users\xxa\Desktop\U-Time-main\U-Time-main (initialized project: False)

2024/04/07 19:05:58 | INFO | Seeding TensorFlow, numpy and random modules with seed: 123

2024/04/07 19:05:59 | INFO | Logs will not be saved to file for these loggers: [<Logger utime (INFO)>, <Logger psg_utils (INFO)>] (--log_file_name is empty)

2024/04/07 19:05:59 | INFO | Creating directory at C:\Users\xxa\Desktop\U-Time-main\U-Time-main\data\sedf_sc\views\fixed_split

2024/04/07 19:05:59 | INFO | OBS: Pairing files based on regex 'SC4(\d{2}).*'
Traceback (most recent call last):
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\Scripts\ut-script.py", line 33, in <module>
    sys.exit(load_entry_point('utime==1.1.8', 'console_scripts', 'ut')())
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\lib\site-packages\utime-1.1.8-py3.7.egg\utime\bin\ut.py", line 103, in entry_func
    mod.entry_func(script_args + help_agrs)
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\lib\site-packages\utime-1.1.8-py3.7.egg\utime\bin\cv_split.py", line 404, in entry_func
    run(args)
  File "H:\SoftWares\Working\Anaconda\envs\u-sleep\lib\site-packages\utime-1.1.8-py3.7.egg\utime\bin\cv_split.py", line 336, in run
    raise ValueError(f"CV ({n_splits}) cannot be larger than number of "
ValueError: CV (1) cannot be larger than number of subjects (0)

@happybegining
Copy link

Hello, @kun2001github, can you open and take a screenshot to see the folder of the dataset? I think this error occurs when your data set is empty.

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