Hi All,
When I tried running Lesson 1 notebook on another dataset from kaggle https://www.kaggle.com/slothkong/10-monkey-species. I got an error at the code
learn = ConvLearner.pretrained(arch, data, precompute=True)
The error was
`---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-60-7c6e7d4eb358> in <module>()
1 arch=resnet34
2 data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz), bs=8)
----> 3 learn = ConvLearner.pretrained(arch, data, precompute=True)
4 learn.fit(0.01, 2)
~/fastai/courses/dl1/fastai/conv_learner.py in pretrained(cls, f, data, ps, xtra_fc, xtra_cut, custom_head, precompute, pretrained, **kwargs)
111 pretrained=True, **kwargs):
112 models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg,
--> 113 ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut, custom_head=custom_head, pretrained=pretrained)
114 return cls(data, models, precompute, **kwargs)
115
~/fastai/courses/dl1/fastai/conv_learner.py in __init__(self, f, c, is_multi, is_reg, ps, xtra_fc, xtra_cut, custom_head, pretrained)
49 else: fc_layers = self.get_fc_layers()
50 self.n_fc = len(fc_layers)
---> 51 self.fc_model = to_gpu(nn.Sequential(*fc_layers))
52 if not custom_head: apply_init(self.fc_model, kaiming_normal)
53 self.model = to_gpu(nn.Sequential(*(layers+fc_layers)))
~/fastai/courses/dl1/fastai/core.py in to_gpu(x, *args, **kwargs)
65 def to_gpu(x, *args, **kwargs):
66 '''puts pytorch variable to gpu, if cuda is avaialble and USE_GPU is set to true. '''
---> 67 return x.cuda(*args, **kwargs) if USE_GPU else x
68
69 def noop(*args, **kwargs): return
~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in cuda(self, device)
214 Module: self
215 """
--> 216 return self._apply(lambda t: t.cuda(device))
217
218 def cpu(self):
~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in _apply(self, fn)
144 def _apply(self, fn):
145 for module in self.children():
--> 146 module._apply(fn)
147
148 for param in self._parameters.values():
~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in _apply(self, fn)
150 # Variables stored in modules are graph leaves, and we don't
151 # want to create copy nodes, so we have to unpack the data.
--> 152 param.data = fn(param.data)
153 if param._grad is not None:
154 param._grad.data = fn(param._grad.data)
~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in <lambda>(t)
214 Module: self
215 """
--> 216 return self._apply(lambda t: t.cuda(device))
217
218 def cpu(self):
~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/_utils.py in _cuda(self, device, async)
67 else:
68 new_type = getattr(torch.cuda, self.__class__.__name__)
---> 69 return new_type(self.size()).copy_(self, async)
70
71
RuntimeError: cuda runtime error (4) : unspecified launch failure at /opt/conda/conda-bld/pytorch_1518244421288/work/torch/lib/THC/generic/THCTensorCopy.c:20`.
I couldn’t understand the reason for this. If someone can help.