I am having issue while running ImageClassifier.from_csv.
This is the line of codes I have
PATH=âdata/pascal-localisationâ
JPEGS=âJPEGImagesâ
CSV=âdata/pascal-localisation/tmp/lrg.csvâ
tfms = tfms_from_model(f_model, sz, aug_tfms=transforms_side_on, crop_type=CropType.NO)
md = ImageClassifierData.from_csv(PATH, JPEGS, CSV, tfms=tfms, bs=bs)
With error stack trace:
IndexError Traceback (most recent call last)
in ()
3 CSV=ââŚ/data/pascal-localisation/tmp/lrg.csvâ
4 tfms = tfms_from_model(f_model, sz, aug_tfms=transforms_side_on, crop_type=CropType.NO)
----> 5 md = ImageClassifierData.from_csv(PATH, JPEGS, CSV, tfms=tfms, bs=bs)
~/anaconda3/lib/python3.6/site-packages/fastai/dataset.py in from_csv(cls, path, folder, csv_fname, bs, tfms, val_idxs, suffix, test_name, continuous, skip_header, num_workers)
351 ââ"
352 fnames,y,classes = csv_source(folder, csv_fname, skip_header, suffix, continuous=continuous)
â> 353 ((val_fnames,trn_fnames),(val_y,trn_y)) = split_by_idx(val_idxs, np.array(fnames), y)
354
355 test_fnames = read_dir(path, test_name) if test_name else None
~/anaconda3/lib/python3.6/site-packages/fastai/dataset.py in split_by_idx(idxs, *a)
364 def split_by_idx(idxs, *a):
365 mask = np.zeros(len(a[0]),dtype=bool)
â> 366 mask[np.array(idxs)] = True
367 return [(o[mask],o[~mask]) for o in a]
IndexError: arrays used as indices must be of integer (or boolean) type
I felt that its due to the wrong folder location. I ran the code from github pointing to the correct folder, it worked. Later, I moved my ipynb to the same folder and ran one more time. It ran. But When I run from the actual location I am intending to run, it fails with the above error. I am truck with this error for a couple of days. Any help would help.