Empty Data Error with Planet Script


(Khizer Hayat) #1

Hello,
I am trying to run the get_data function in the planet script but get the below error. I’m not sure what’s going on as I have uploaded all the required files.

>     ---------------------------------------------------------------------------
>     EmptyDataError                            Traceback (most recent call last)
>     <ipython-input-14-74a9916c857d> in <module>
>     ----> 1 data = get_data(256)
> 
>     <ipython-input-11-521a6e4b7ee8> in get_data(sz)
>           2     tfms = tfms_from_model(f_model, sz, aug_tfms=transforms_top_down, max_zoom=1.05)
>           3     return ImageClassifierData.from_csv(PATH, 'train-jpg', label_csv, tfms=tfms,
>     ----> 4                     suffix='.jpg', val_idxs=val_idxs, test_name='test-jpg')
> 
>     ~/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, cat_separator)
>         549         assert not (tfms[0] is None or tfms[1] is None), "please provide transformations for your train and validation sets"
>         550         assert not (os.path.isabs(folder)), "folder needs to be a relative path"
>     --> 551         fnames,y,classes = csv_source(folder, csv_fname, skip_header, suffix, continuous=continuous, cat_separator=cat_separator)
>         552         return cls.from_names_and_array(path, fnames, y, classes, val_idxs, test_name,
>         553                 num_workers=num_workers, suffix=suffix, tfms=tfms, bs=bs, continuous=continuous)
> 
>     ~/fastai/courses/dl1/fastai/dataset.py in csv_source(folder, csv_file, skip_header, suffix, continuous, cat_separator)
>         169 
>         170 def csv_source(folder, csv_file, skip_header=True, suffix='', continuous=False, cat_separator=' '):
>     --> 171     fnames,csv_labels = parse_csv_labels(csv_file, skip_header, cat_separator)
>         172     return dict_source(folder, fnames, csv_labels, suffix, continuous)
>         173 
> 
>     ~/fastai/courses/dl1/fastai/dataset.py in parse_csv_labels(fn, skip_header, cat_separator)
>         157     :param cat_separator: the separator for the categories column
>         158     """
>     --> 159     df = pd.read_csv(fn, index_col=0, header=0 if skip_header else None, dtype=str)
>         160     fnames = df.index.values
>         161     df.iloc[:,0] = df.iloc[:,0].str.split(cat_separator)
> 
>     ~/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, doublequote, delim_whitespace, low_memory, memory_map, float_precision)
>         676                     skip_blank_lines=skip_blank_lines)
>         677 
>     --> 678         return _read(filepath_or_buffer, kwds)
>         679 
>         680     parser_f.__name__ = name
> 
>     ~/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds)
>         438 
>         439     # Create the parser.
>     --> 440     parser = TextFileReader(filepath_or_buffer, **kwds)
>         441 
>         442     if chunksize or iterator:
> 
>     ~/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/io/parsers.py in __init__(self, f, engine, **kwds)
>         785             self.options['has_index_names'] = kwds['has_index_names']
>         786 
>     --> 787         self._make_engine(self.engine)
>         788 
>         789     def close(self):
> 
>     ~/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/io/parsers.py in _make_engine(self, engine)
>        1012     def _make_engine(self, engine='c'):
>        1013         if engine == 'c':
>     -> 1014             self._engine = CParserWrapper(self.f, **self.options)
>        1015         else:
>        1016             if engine == 'python':
> 
>     ~/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/io/parsers.py in __init__(self, src, **kwds)
>        1706         kwds['usecols'] = self.usecols
>        1707 
>     -> 1708         self._reader = parsers.TextReader(src, **kwds)
>        1709 
>        1710         passed_names = self.names is None
> 
>     pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.__cinit__()
> 
>     EmptyDataError: No columns to parse from file