jfilter / split-folders

🗂 Split folders with files (i.e. images) into training, validation and test (dataset) folders

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while specifying only ratio and image folder with CLI

ashnair1 opened this issue · comments

splitfolders --ratio .8 .2 img_folder throws the following error

usage: splitfolders [-h] [--output OUTPUT] [--seed SEED]
                    [--ratio RATIO [RATIO ...]] [--fixed FIXED [FIXED ...]]
                    [--oversample] [--group_prefix GROUP_PREFIX]
                    input
splitfolders: error: argument --ratio: invalid float value: 'img_folder'

Thanks for reporting. This looks like a bug (or at least a very rough edge) of Python's argparse. https://stackoverflow.com/a/26986546/4028896

Please use it like this:

splitfolders --ratio .8 .2 -- img_folder

I will update the docs.