I am running the following code for my model
data = ImageClassifierData.from_csv(PATH, 'boneage-training-dataset',label_csv , bs = 64, tfms=(None,None), val_idxs=val_idxs, suffix='.png',test_name=None, continuous=False, skip_header=True, num_workers=4)
However i get this error
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-95-3b0293571f6a> in <module>()
----> 1 data = ImageClassifierData.from_csv(PATH, 'boneage-training-dataset',label_csv , bs = 64, tfms=(None,None), val_idxs=val_idxs, suffix='.png',test_name=None, continuous=False, skip_header=True, num_workers=4)
2 learn = ConvLearner.pretrained(arch,data,precompute=True)
3
4 #ImageClassifierData.from_csv(path, folder, csv_fname, bs=64, tfms=(None, None), val_idxs=None, suffix='', test_name=None, continuous=False, skip_header=True, num_workers=8)
~/fastai/courses/dl1/fastai/dataset.py in from_csv(cls, path, folder, csv_fname, bs, tfms, val_idxs, suffix, test_name, continuous, skip_header, num_workers)
345 ImageClassifierData
346 """
--> 347 fnames,y,classes = csv_source(folder, csv_fname, skip_header, suffix, continuous=continuous)
348 ((val_fnames,trn_fnames),(val_y,trn_y)) = split_by_idx(val_idxs, np.array(fnames), y)
349
~/fastai/courses/dl1/fastai/dataset.py in csv_source(folder, csv_file, skip_header, suffix, continuous)
73
74 def csv_source(folder, csv_file, skip_header=True, suffix='', continuous=False):
---> 75 fnames,csv_labels,all_labels,label2idx = parse_csv_labels(csv_file, skip_header)
76 full_names = [os.path.join(folder,fn+suffix) for fn in fnames]
77 if continuous:
~/fastai/courses/dl1/fastai/dataset.py in parse_csv_labels(fn, skip_header)
62 skip = 1 if skip_header else 0
63 csv_lines = [o.strip().split(',') for o in open(fn)][skip:]
---> 64 csv_labels = {a:b.split(' ') for a,b in csv_lines}
65 all_labels = sorted(list(set(p for o in csv_labels.values() for p in o)))
66 label2idx = {v:k for k,v in enumerate(all_labels)}
~/fastai/courses/dl1/fastai/dataset.py in <dictcomp>(.0)
62 skip = 1 if skip_header else 0
63 csv_lines = [o.strip().split(',') for o in open(fn)][skip:]
---> 64 csv_labels = {a:b.split(' ') for a,b in csv_lines}
65 all_labels = sorted(list(set(p for o in csv_labels.values() for p in o)))
66 label2idx = {v:k for k,v in enumerate(all_labels)}
ValueError: too many values to unpack (expected 2)
My CSV file head is s below
id boneage male
1377 180 FALSE
1378 12 FALSE
1379 94 FALSE
1380 120 TRUE
Is it because it has multiple variables that i get this error ? Should i adjust anything in my code or in the read csv section?
Here is how i am reading the labels
label_csv = f'{PATH}train.csv'
n = len(list(open(label_csv)))-1
val_idxs = get_cv_idxs(n)
Thanks