Hi All,
I have just started setting up my Macbook Pro for the fast.ai course. Had to spent almost 2 days! No complaining there as I got to learn a lot of things while doing so.
But as soon as I started executing the snippets from the lesson1.pynb I get the following error:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-18-e6c87b20ce86> in <module>()
1 arch=resnet34
2 data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
----> 3 learn = ConvLearner.pretrained(arch, data, precompute=True)
4 learn.fit(0.01, 2)
~/Anaconda/anaconda3/lib/python3.6/site-packages/fastai/conv_learner.py in pretrained(cls, f, data, ps, xtra_fc, xtra_cut, **kwargs)
92 @classmethod
93 def pretrained(cls, f, data, ps=None, xtra_fc=None, xtra_cut=0, **kwargs):
---> 94 models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg, ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut)
95 return cls(data, models, **kwargs)
96
~/Anaconda/anaconda3/lib/python3.6/site-packages/fastai/conv_learner.py in __init__(self, f, c, is_multi, is_reg, ps, xtra_fc, xtra_cut)
47 self.n_fc = len(fc_layers)
48 self.fc_model = to_gpu(nn.Sequential(*fc_layers))
---> 49 apply_init(self.fc_model, kaiming_normal)
50 self.model = to_gpu(nn.Sequential(*(layers+fc_layers)))
51
~/Anaconda/anaconda3/lib/python3.6/site-packages/fastai/initializers.py in apply_init(m, init_fn)
8
9 def apply_init(m, init_fn):
---> 10 m.apply(lambda x: cond_init(x, init_fn))
11
12
~/Anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in apply(self, fn)
196 """
197 for module in self.children():
--> 198 module.apply(fn)
199 fn(self)
200 return self
~/Anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in apply(self, fn)
197 for module in self.children():
198 module.apply(fn)
--> 199 fn(self)
200 return self
201
~/Anaconda/anaconda3/lib/python3.6/site-packages/fastai/initializers.py in <lambda>(x)
8
9 def apply_init(m, init_fn):
---> 10 m.apply(lambda x: cond_init(x, init_fn))
11
12
~/Anaconda/anaconda3/lib/python3.6/site-packages/fastai/initializers.py in cond_init(m, init_fn)
5 if not isinstance(m, (nn.BatchNorm1d,nn.BatchNorm2d,nn.BatchNorm3d)):
6 if hasattr(m, 'weight'): init_fn(m.weight)
----> 7 if hasattr(m, 'bias'): m.bias.data.fill_(0.)
8
9 def apply_init(m, init_fn):
RuntimeError: cuda runtime error (2) : out of memory at /Users/dhiman63/pytorch/aten/src/THC/generic/THCTensorMath.cu:15
My Macbook Pro has 2 GB of Graphics Memory (NVIDIA GeForce GT 750M).
Any help is appreciated!
Thanks,
Dhiman