If my folder has 4567 files and I want to split all of them into train, val and test folders with desired numbers:
splitfolders.fixed(input, output=output, seed=1337, fixed(3000, 1000, 567))
it will show an error message:
if not len(files) > sum(fixed):
raise ValueError(
f'The number of samples in class "{class_dir.stem}" are too few. There are only {len(files)} samples available but your fixed parameter {fixed} requires at least {sum(fixed)} files. You may want to split your classes by ratio.'
)``
Suggestion to fix the bug by using >= instead of >, so that if all the fixed numbers sum up equals to the length of files, it can proceed without error:
if not len(files) >= sum(fixed):
raise ValueError(
f'The number of samples in class "{class_dir.stem}" are too few. There are only {len(files)} samples available but your fixed parameter {fixed} requires at least {sum(fixed)} files. You may want to split your classes by ratio.'
)``
If my folder has 4567 files and I want to split all of them into train, val and test folders with desired numbers: splitfolders.fixed(input, output=output, seed=1337, fixed(3000, 1000, 567))
it will show an error message:
Suggestion to fix the bug by using >= instead of >, so that if all the fixed numbers sum up equals to the length of files, it can proceed without error: