You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in label_from_folder(self, label_cls, **kwargs)
299 "Give a label to each filename depending on its folder."
300 return self.label_from_func(func=lambda o: (o.parts if isinstance(o, Path) else o.split(os.path.sep))[-2],
--> 301 label_cls=label_cls, **kwargs)
302
303 def label_from_re(self, pat:str, full_path:bool=False, label_cls:Callable=None, **kwargs)->'LabelList':
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in label_from_func(self, func, label_cls, **kwargs)
294 def label_from_func(self, func:Callable, label_cls:Callable=None, **kwargs)->'LabelList':
295 "Apply func to every input to get its label."
--> 296 return self._label_from_list([func(o) for o in self.items], label_cls=label_cls, **kwargs)
297
298 def label_from_folder(self, label_cls:Callable=None, **kwargs)->'LabelList':
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in _label_from_list(self, labels, label_cls, from_item_lists, **kwargs)
269 raise Exception("Your data isn't split, if you don't want a validation set, please use split_none.")
270 labels = array(labels, dtype=object)
--> 271 label_cls = self.get_label_cls(labels, label_cls=label_cls, **kwargs)
272 y = label_cls(labels, path=self.path, **kwargs)
273 res = self._label_list(x=self, y=y)
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in get_label_cls(self, labels, label_cls, label_delim, **kwargs)
258 if self.label_cls is not None: return self.label_cls
259 if label_delim is not None: return MultiCategoryList
--> 260 it = index_row(labels,0)
261 if isinstance(it, (float, np.float32)): return FloatList
262 if isinstance(try_int(it), (str, Integral)): return CategoryList
/root/miniconda3/lib/python3.7/site-packages/fastai/core.py in index_row(a, idxs)
274 if isinstance(res,(pd.DataFrame,pd.Series)): return res.copy()
275 return res
--> 276 return a[idxs]
277
278 def func_args(func)->bool:
IndexError: index 0 is out of bounds for axis 0 with size 0
The text was updated successfully, but these errors were encountered:
Hi there, just closing this issue since the tests are passing on GCP and it doesn't seem there is anything we can do on our side to help (please fell free to correct me if I'm wrong).
Can someone confirm is this is problems with containers or with the latest update in fasai?
container: gcr.io/deeplearning-platform-release/pytorch-cpu
Error stack:
Exception encountered at "In [3]":
IndexError Traceback (most recent call last)
in
1 path = untar_data(URLs.MNIST_SAMPLE)
----> 2 data = ImageDataBunch.from_folder(path)
3 learn = cnn_learner(data, models.resnet18, metrics=accuracy)
/root/miniconda3/lib/python3.7/site-packages/fastai/vision/data.py in from_folder(cls, path, train, valid, valid_pct, seed, classes, **kwargs)
108 if valid_pct is None: src = il.split_by_folder(train=train, valid=valid)
109 else: src = il.split_by_rand_pct(valid_pct, seed)
--> 110 src = src.label_from_folder(classes=classes)
111 return cls.create_from_ll(src, **kwargs)
112
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in _inner(*args, **kwargs)
470 assert isinstance(fv, Callable)
471 def _inner(*args, **kwargs):
--> 472 self.train = ft(*args, from_item_lists=True, **kwargs)
473 assert isinstance(self.train, LabelList)
474 kwargs['label_cls'] = self.train.y.class
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in label_from_folder(self, label_cls, **kwargs)
299 "Give a label to each filename depending on its folder."
300 return self.label_from_func(func=lambda o: (o.parts if isinstance(o, Path) else o.split(os.path.sep))[-2],
--> 301 label_cls=label_cls, **kwargs)
302
303 def label_from_re(self, pat:str, full_path:bool=False, label_cls:Callable=None, **kwargs)->'LabelList':
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in label_from_func(self, func, label_cls, **kwargs)
294 def label_from_func(self, func:Callable, label_cls:Callable=None, **kwargs)->'LabelList':
295 "Apply
func
to every input to get its label."--> 296 return self._label_from_list([func(o) for o in self.items], label_cls=label_cls, **kwargs)
297
298 def label_from_folder(self, label_cls:Callable=None, **kwargs)->'LabelList':
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in _label_from_list(self, labels, label_cls, from_item_lists, **kwargs)
269 raise Exception("Your data isn't split, if you don't want a validation set, please use
split_none
.")270 labels = array(labels, dtype=object)
--> 271 label_cls = self.get_label_cls(labels, label_cls=label_cls, **kwargs)
272 y = label_cls(labels, path=self.path, **kwargs)
273 res = self._label_list(x=self, y=y)
/root/miniconda3/lib/python3.7/site-packages/fastai/data_block.py in get_label_cls(self, labels, label_cls, label_delim, **kwargs)
258 if self.label_cls is not None: return self.label_cls
259 if label_delim is not None: return MultiCategoryList
--> 260 it = index_row(labels,0)
261 if isinstance(it, (float, np.float32)): return FloatList
262 if isinstance(try_int(it), (str, Integral)): return CategoryList
/root/miniconda3/lib/python3.7/site-packages/fastai/core.py in index_row(a, idxs)
274 if isinstance(res,(pd.DataFrame,pd.Series)): return res.copy()
275 return res
--> 276 return a[idxs]
277
278 def func_args(func)->bool:
IndexError: index 0 is out of bounds for axis 0 with size 0
The text was updated successfully, but these errors were encountered: