I’ve been trying to train a tabular model with the riiid dataset, and I keep getting the following error, and I cannot find any resources to help with this. Does anybody know what this is about??
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
d:\deep learning\fastai\fastai\learner.py in _with_events(self, f, event_type, ex, final)
154 def _with_events(self, f, event_type, ex, final=noop):
--> 155 try: self(f'before_{event_type}') ;f()
156 except ex: self(f'after_cancel_{event_type}')
d:\deep learning\fastai\fastai\learner.py in __call__(self, event_name)
132
--> 133 def __call__(self, event_name): L(event_name).map(self._call_one)
134
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in map(self, f, gen, *args, **kwargs)
279 if gen: return res
--> 280 return self._new(res)
281
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in _new(self, items, *args, **kwargs)
223 def _xtra(self): return None
--> 224 def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)
225 def __getitem__(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in __call__(cls, x, *args, **kwargs)
204 if not args and not kwargs and x is not None and isinstance(x,cls): return x
--> 205 return super().__call__(x, *args, **kwargs)
206
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in __init__(self, items, use_list, match, *rest)
214 if (use_list is not None) or not _is_array(items):
--> 215 items = list(items) if use_list else _listify(items)
216 if match is not None:
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in _listify(o)
115 if isinstance(o, str) or _is_array(o): return [o]
--> 116 if is_iter(o): return list(o)
117 return [o]
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in __call__(self, *args, **kwargs)
178 fargs = [args[x.i] if isinstance(x, _Arg) else x for x in self.pargs] + args[self.maxi+1:]
--> 179 return self.fn(*fargs, **kwargs)
180
d:\deep learning\fastai\fastai\learner.py in _call_one(self, event_name)
136 assert hasattr(event, event_name), event_name
--> 137 [cb(event_name) for cb in sort_by_run(self.cbs)]
138
d:\deep learning\fastai\fastai\learner.py in <listcomp>(.0)
136 assert hasattr(event, event_name), event_name
--> 137 [cb(event_name) for cb in sort_by_run(self.cbs)]
138
d:\deep learning\fastai\fastai\callback\core.py in __call__(self, event_name)
43 res = None
---> 44 if self.run and _run: res = getattr(self, event_name, noop)()
45 if event_name=='after_fit': self.run=True #Reset self.run to True at each end of fit
d:\deep learning\fastai\fastai\callback\schedule.py in before_fit(self)
179 super().before_fit()
--> 180 self.learn.save('_tmp')
181 self.best_loss = float('inf')
d:\deep learning\fastai\fastai\learner.py in save(self, file, **kwargs)
282 file = join_path_file(file, self.path/self.model_dir, ext='.pth')
--> 283 save_model(file, self.model, getattr(self,'opt',None), **kwargs)
284 return file
d:\deep learning\fastai\fastai\learner.py in save_model(file, model, opt, with_opt, pickle_protocol)
46 if with_opt: state = {'model': state, 'opt':opt.state_dict()}
---> 47 torch.save(state, file, pickle_protocol=pickle_protocol)
48
D:\Anaconda\envs\Deep_learning\lib\site-packages\torch\serialization.py in save(obj, f, pickle_module, pickle_protocol, _use_new_zipfile_serialization)
363 with _open_zipfile_writer(opened_file) as opened_zipfile:
--> 364 _save(obj, opened_zipfile, pickle_module, pickle_protocol)
365 return
D:\Anaconda\envs\Deep_learning\lib\site-packages\torch\serialization.py in _save(obj, zip_file, pickle_module, pickle_protocol)
480 buf = io.BytesIO()
--> 481 storage._write_file(buf, _should_read_directly(buf))
482 buf_value = buf.getvalue()
MemoryError:
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
<ipython-input-12-d81c6bd29d71> in <module>
----> 1 learn.lr_find()
d:\deep learning\fastai\fastai\callback\schedule.py in lr_find(self, start_lr, end_lr, num_it, stop_div, show_plot, suggestions)
226 n_epoch = num_it//len(self.dls.train) + 1
227 cb=LRFinder(start_lr=start_lr, end_lr=end_lr, num_it=num_it, stop_div=stop_div)
--> 228 with self.no_logging(): self.fit(n_epoch, cbs=cb)
229 if show_plot: self.recorder.plot_lr_find()
230 if suggestions:
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\logargs.py in _f(*args, **kwargs)
54 init_args.update(log)
55 setattr(inst, 'init_args', init_args)
---> 56 return inst if to_return else f(*args, **kwargs)
57 return _f
d:\deep learning\fastai\fastai\learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
205 self.opt.set_hypers(lr=self.lr if lr is None else lr)
206 self.n_epoch = n_epoch
--> 207 self._with_events(self._do_fit, 'fit', CancelFitException, self._end_cleanup)
208
209 def _end_cleanup(self): self.dl,self.xb,self.yb,self.pred,self.loss = None,(None,),(None,),None,None
d:\deep learning\fastai\fastai\learner.py in _with_events(self, f, event_type, ex, final)
155 try: self(f'before_{event_type}') ;f()
156 except ex: self(f'after_cancel_{event_type}')
--> 157 finally: self(f'after_{event_type}') ;final()
158
159 def all_batches(self):
d:\deep learning\fastai\fastai\learner.py in __call__(self, event_name)
131 def ordered_cbs(self, event): return [cb for cb in sort_by_run(self.cbs) if hasattr(cb, event)]
132
--> 133 def __call__(self, event_name): L(event_name).map(self._call_one)
134
135 def _call_one(self, event_name):
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in map(self, f, gen, *args, **kwargs)
278 res = map(g, self)
279 if gen: return res
--> 280 return self._new(res)
281
282 def filter(self, f=noop, negate=False, gen=False, **kwargs):
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in _new(self, items, *args, **kwargs)
222 @property
223 def _xtra(self): return None
--> 224 def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)
225 def __getitem__(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
226 def copy(self): return self._new(self.items.copy())
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in __call__(cls, x, *args, **kwargs)
203 def __call__(cls, x=None, *args, **kwargs):
204 if not args and not kwargs and x is not None and isinstance(x,cls): return x
--> 205 return super().__call__(x, *args, **kwargs)
206
207 # Cell
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in __init__(self, items, use_list, match, *rest)
213 if items is None: items = []
214 if (use_list is not None) or not _is_array(items):
--> 215 items = list(items) if use_list else _listify(items)
216 if match is not None:
217 if is_coll(match): match = len(match)
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in _listify(o)
114 if isinstance(o, list): return o
115 if isinstance(o, str) or _is_array(o): return [o]
--> 116 if is_iter(o): return list(o)
117 return [o]
118
D:\Anaconda\envs\Deep_learning\lib\site-packages\fastcore\foundation.py in __call__(self, *args, **kwargs)
177 if isinstance(v,_Arg): kwargs[k] = args.pop(v.i)
178 fargs = [args[x.i] if isinstance(x, _Arg) else x for x in self.pargs] + args[self.maxi+1:]
--> 179 return self.fn(*fargs, **kwargs)
180
181 # Cell
d:\deep learning\fastai\fastai\learner.py in _call_one(self, event_name)
135 def _call_one(self, event_name):
136 assert hasattr(event, event_name), event_name
--> 137 [cb(event_name) for cb in sort_by_run(self.cbs)]
138
139 def _bn_bias_state(self, with_bias): return norm_bias_params(self.model, with_bias).map(self.opt.state)
d:\deep learning\fastai\fastai\learner.py in <listcomp>(.0)
135 def _call_one(self, event_name):
136 assert hasattr(event, event_name), event_name
--> 137 [cb(event_name) for cb in sort_by_run(self.cbs)]
138
139 def _bn_bias_state(self, with_bias): return norm_bias_params(self.model, with_bias).map(self.opt.state)
d:\deep learning\fastai\fastai\callback\core.py in __call__(self, event_name)
42 (self.run_valid and not getattr(self, 'training', False)))
43 res = None
---> 44 if self.run and _run: res = getattr(self, event_name, noop)()
45 if event_name=='after_fit': self.run=True #Reset self.run to True at each end of fit
46 return res
d:\deep learning\fastai\fastai\callback\schedule.py in after_fit(self)
196 tmp_f = self.path/self.model_dir/'_tmp.pth'
197 if tmp_f.exists():
--> 198 self.learn.load('_tmp')
199 os.remove(tmp_f)
200
d:\deep learning\fastai\fastai\learner.py in load(self, file, with_opt, device, **kwargs)
289 if self.opt is None: self.create_opt()
290 file = join_path_file(file, self.path/self.model_dir, ext='.pth')
--> 291 load_model(file, self.model, self.opt, device=device, **kwargs)
292 return self
293
d:\deep learning\fastai\fastai\learner.py in load_model(file, model, opt, with_opt, device, strict)
53 if isinstance(device, int): device = torch.device('cuda', device)
54 elif device is None: device = 'cpu'
---> 55 state = torch.load(file, map_location=device)
56 hasopt = set(state)=={'model', 'opt'}
57 model_state = state['model'] if hasopt else state
D:\Anaconda\envs\Deep_learning\lib\site-packages\torch\serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
582 opened_file.seek(orig_position)
583 return torch.jit.load(opened_file)
--> 584 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
585 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
586
D:\Anaconda\envs\Deep_learning\lib\site-packages\torch\serialization.py in _load(zip_file, map_location, pickle_module, **pickle_load_args)
840 unpickler = pickle_module.Unpickler(data_file, **pickle_load_args)
841 unpickler.persistent_load = persistent_load
--> 842 result = unpickler.load()
843
844 return result
D:\Anaconda\envs\Deep_learning\lib\site-packages\torch\serialization.py in persistent_load(saved_id)
832 data_type, key, location, size = data
833 if key not in loaded_storages:
--> 834 load_tensor(data_type, size, key, _maybe_decode_ascii(location))
835 storage = loaded_storages[key]
836 return storage
D:\Anaconda\envs\Deep_learning\lib\site-packages\torch\serialization.py in load_tensor(data_type, size, key, location)
820 dtype = data_type(0).dtype
821
--> 822 storage = zip_file.get_storage_from_record(name, size, dtype).storage()
823 loaded_storages[key] = restore_location(storage, location)
824
RuntimeError: [enforce fail at ..\caffe2\serialize\inline_container.cc:209] . file not found: archive/data/1574199856320