Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the latest Google Cloud DL Container basic_train.ipynb does not work #2324

Closed
b0noI opened this issue Sep 11, 2019 · 5 comments
Closed

On the latest Google Cloud DL Container basic_train.ipynb does not work #2324

b0noI opened this issue Sep 11, 2019 · 5 comments

Comments

@b0noI
Copy link

b0noI commented Sep 11, 2019

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

@sgugger
Copy link
Contributor

sgugger commented Sep 11, 2019

I don't have any problem running this on master or v.1.0.57.

@sgugger
Copy link
Contributor

sgugger commented Sep 13, 2019

It seems the tests are passing again on GCP, is this still an issue?

@b0noI
Copy link
Author

b0noI commented Sep 19, 2019

bug is still there, however due to another bug with papermill it not always reaches the line where it fails :( I will dive deeper to this

@Imunique19
Copy link

@ #2404 #

@sgugger
Copy link
Contributor

sgugger commented Dec 9, 2019

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).

@sgugger sgugger closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants