jfilter / split-folders

🗂 Split folders with files (i.e. images) into training, validation and test (dataset) folders
MIT License
414 stars 72 forks source link

AttributeError: 'PosixPath' object has no attribute 'rfind' #2

Closed pigubaoza closed 5 years ago

pigubaoza commented 5 years ago

I did a split_folders with --ratio .8 .2, and got the following error:

Traceback (most recent call last): File "/root/.virtualenvs/data-manipulation/bin/split_folders", line 27, in split_folders.ratio(args.input, args.output, args.seed, args.ratio) File "/root/.virtualenvs/data-manipulation/lib/python3.5/site-packages/split_folders/split.py", line 58, in ratio split_class_dir_ratio(class_dir, output, ratio, seed) File "/root/.virtualenvs/data-manipulation/lib/python3.5/site-packages/split_folders/split.py", line 126, in split_class_dir_ratio copy_files(li, class_dir, output) File "/root/.virtualenvs/data-manipulation/lib/python3.5/site-packages/split_folders/split.py", line 148, in copy_files class_name = path.split(class_dir)[1] File "/root/.virtualenvs/data-manipulation/lib/python3.5/posixpath.py", line 103, in split i = p.rfind(sep) + 1 AttributeError: 'PosixPath' object has no attribute 'rfind'

the same problem happens with python 2.7.12 and python 3.5.2

jfilter commented 5 years ago

This package is for Python 3.6+ so 3.5 and lower are not supported. Please upgrade your Python installation and check if it works for you.