Lesson 1 OS Error

Hi!

I am currently trying to do “running your first notebook” but I keep getting OS Error (pasted below). Additionally, I keep getting the same error for the first cells as well. I am not quite sure what to do. I am using paperspace. Any help is appreciated! Thanks!

OSError Traceback (most recent call last)
in
9
10 learn = cnn_learner(dls, resnet34, metrics=error_rate)
—> 11 learn.fine_tune(1)

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/callback/schedule.py in fine_tune(self, epochs, base_lr, freeze_epochs, lr_mult, pct_start, div, **kwargs)
155 “Fine tune with freeze for freeze_epochs then with unfreeze from epochs using discriminative LR”
156 self.freeze()
–> 157 self.fit_one_cycle(freeze_epochs, slice(base_lr), pct_start=0.99, **kwargs)
158 base_lr /= 2
159 self.unfreeze()

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/callback/schedule.py in fit_one_cycle(self, n_epoch, lr_max, div, div_final, pct_start, wd, moms, cbs, reset_opt)
110 scheds = {‘lr’: combined_cos(pct_start, lr_max/div, lr_max, lr_max/div_final),
111 ‘mom’: combined_cos(pct_start, *(self.moms if moms is None else moms))}
–> 112 self.fit(n_epoch, cbs=ParamScheduler(scheds)+L(cbs), reset_opt=reset_opt, wd=wd)
113
114 # Cell

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
209 self.opt.set_hypers(lr=self.lr if lr is None else lr)
210 self.n_epoch = n_epoch
–> 211 self._with_events(self._do_fit, ‘fit’, CancelFitException, self._end_cleanup)
212
213 def _end_cleanup(self): self.dl,self.xb,self.yb,self.pred,self.loss = None,(None,),(None,),None,None

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
158
159 def with_events(self, f, event_type, ex, final=noop):
–> 160 try: self(f’before
{event_type}’); f()
161 except ex: self(f’after_cancel
{event_type}’)
162 self(f’after_{event_type}’); final()

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in _do_fit(self)
200 for epoch in range(self.n_epoch):
201 self.epoch=epoch
–> 202 self._with_events(self._do_epoch, ‘epoch’, CancelEpochException)
203
204 def fit(self, n_epoch, lr=None, wd=None, cbs=None, reset_opt=False):

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
158
159 def with_events(self, f, event_type, ex, final=noop):
–> 160 try: self(f’before
{event_type}’); f()
161 except ex: self(f’after_cancel
{event_type}’)
162 self(f’after_{event_type}’); final()

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in _do_epoch(self)
194
195 def _do_epoch(self):
–> 196 self._do_epoch_train()
197 self._do_epoch_validate()
198

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in _do_epoch_train(self)
186 def _do_epoch_train(self):
187 self.dl = self.dls.train
–> 188 self._with_events(self.all_batches, ‘train’, CancelTrainException)
189
190 def _do_epoch_validate(self, ds_idx=1, dl=None):

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
158
159 def with_events(self, f, event_type, ex, final=noop):
–> 160 try: self(f’before
{event_type}’); f()
161 except ex: self(f’after_cancel
{event_type}’)
162 self(f’after_{event_type}’); final()

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/learner.py in all_batches(self)
164 def all_batches(self):
165 self.n_iter = len(self.dl)
–> 166 for o in enumerate(self.dl): self.one_batch(*o)
167
168 def _do_one_batch(self):

/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/data/load.py in iter(self)
99 self.before_iter()
100 self.__idxs=self.get_idxs() # called in context of main process (not workers/subprocesses)
–> 101 for b in _loadersself.fake_l.num_workers==0:
102 if self.device is not None: b = to_device(b, self.device)
103 yield self.after_batch(b)

/opt/conda/envs/fastai/lib/python3.8/site-packages/torch/utils/data/dataloader.py in init(self, loader)
799 # before it starts, and del tries to join but will get:
800 # AssertionError: can only join a started process.
–> 801 w.start()
802 self._index_queues.append(index_queue)
803 self._workers.append(w)

/opt/conda/envs/fastai/lib/python3.8/multiprocessing/process.py in start(self)
119 ‘daemonic processes are not allowed to have children’
120 _cleanup()
–> 121 self._popen = self._Popen(self)
122 self._sentinel = self._popen.sentinel
123 # Avoid a refcycle if the target function holds an indirect

/opt/conda/envs/fastai/lib/python3.8/multiprocessing/context.py in _Popen(process_obj)
222 @staticmethod
223 def _Popen(process_obj):
–> 224 return _default_context.get_context().Process._Popen(process_obj)
225
226 class DefaultContext(BaseContext):

/opt/conda/envs/fastai/lib/python3.8/multiprocessing/context.py in _Popen(process_obj)
275 def _Popen(process_obj):
276 from .popen_fork import Popen
–> 277 return Popen(process_obj)
278
279 class SpawnProcess(process.BaseProcess):

/opt/conda/envs/fastai/lib/python3.8/multiprocessing/popen_fork.py in init(self, process_obj)
17 self.returncode = None
18 self.finalizer = None
—> 19 self._launch(process_obj)
20
21 def duplicate_for_child(self, fd):

/opt/conda/envs/fastai/lib/python3.8/multiprocessing/popen_fork.py in _launch(self, process_obj)
68 parent_r, child_w = os.pipe()
69 child_r, parent_w = os.pipe()
—> 70 self.pid = os.fork()
71 if self.pid == 0:
72 try:

OSError: [Errno 12] Cannot allocate memory

Resolved