Dataset has no validation split
#1
by
robmarkcole
- opened
As title, prevents training with ViT classification demo
Hi,
You can always split a dataset into training + testing using the train_test_split
method:
from datasets import load_dataset
dataset = load_dataset("nielsr/eurosat-demo")
dataset = dataset.train_test_split(test_size=0.1)
This results in AttributeError: 'DatasetDict' object has no attribute 'train_test_split'
Appears you must pass split on load
ds = load_dataset("nielsr/eurosat-demo", split="train")
ds = ds.train_test_split(test_size=0.1)
ds
Oh yes, load_dataset returns a DatasetDict
in case no split is specified, my bad.
You could also do:
from datasets import load_dataset
dataset = load_dataset("nielsr/eurosat-demo")
dataset = dataset['train'].train_test_split(test_size=0.1)
Awesome, thanks for you help!
robmarkcole
changed discussion status to
closed