I know this has been addressed earlier, but today I suddenly started getting NBMasterBar
errors doing a fit_one_cycle
.
AttributeError: 'NBMasterBar' object has no attribute 'out'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
AttributeError: pbar
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in on_iter_end(self)
199 plt.close()
200 self.out2.update(self.fig)
--> 201 total_time = format_time(time() - self.start_t)
202 if self.text.endswith('<p>'): self.text = self.text[:-3]
203 if self.total_time: self.text = f'Total time: {total_time} <p>' + self.text
AttributeError: 'NBMasterBar' object has no attribute 'start_t'
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in _do_epoch_train(self)
254 try:
--> 255 self.dl = self.dbunch.train_dl; self('begin_train')
256 self.all_batches()
44 frames
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in __call__(self, event_name)
214
--> 215 def __call__(self, event_name): L(event_name).map(self._call_one)
216 def _call_one(self, event_name):
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in map(self, f, *args, **kwargs)
362 else f.__getitem__)
--> 363 return self._new(map(g, self))
364
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in _new(self, items, *args, **kwargs)
315 def _xtra(self): return None
--> 316 def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)
317 def __getitem__(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __call__(cls, x, *args, **kwargs)
41
---> 42 res = super().__call__(*((x,) + args), **kwargs)
43 res._newchk = 0
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __init__(self, items, use_list, match, *rest)
306 if (use_list is not None) or not _is_array(items):
--> 307 items = list(items) if use_list else _listify(items)
308 if match is not None:
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in _listify(o)
242 if isinstance(o, str) or _is_array(o): return [o]
--> 243 if is_iter(o): return list(o)
244 return [o]
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __call__(self, *args, **kwargs)
208 fargs = [args[x.i] if isinstance(x, _Arg) else x for x in self.pargs] + args[self.maxi+1:]
--> 209 return self.fn(*fargs, **kwargs)
210
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in _call_one(self, event_name)
217 assert hasattr(event, event_name)
--> 218 [cb(event_name) for cb in sort_by_run(self.cbs)]
219
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in <listcomp>(.0)
217 assert hasattr(event, event_name)
--> 218 [cb(event_name) for cb in sort_by_run(self.cbs)]
219
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in __call__(self, event_name)
20 "Call `self.{event_name}` if it's defined"
---> 21 if self.run: getattr(self, event_name, noop)()
22
/usr/local/lib/python3.6/dist-packages/fastai2/callback/progress.py in begin_train(self)
25
---> 26 def begin_train(self): self._launch_pbar()
27 def begin_validate(self): self._launch_pbar()
/usr/local/lib/python3.6/dist-packages/fastai2/callback/progress.py in _launch_pbar(self)
34 def _launch_pbar(self):
---> 35 self.pbar = progress_bar(self.dl, parent=getattr(self, 'mbar', None), leave=False)
36 if self.pbar.parent is None: self.pbar.on_iter_begin()
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in __init__(self, gen, total, display, leave, parent, auto_update)
158 self.progress = html_progress_bar(0, len(gen) if total is None else total, "")
--> 159 super().__init__(gen, total, display, leave, parent, auto_update)
160
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in __init__(self, gen, total, display, leave, parent, auto_update)
56 self.leave,self.display=False,False
---> 57 parent.add_child(self)
58 self.comment = ''
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in add_child(self, child)
208 self.inner_dict['pb2'] = self.child.progress
--> 209 self.show()
210
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in show(self)
215 self.html_code = '\n'.join([self.inner_dict[n] for n in to_show])
--> 216 self.out.update(HTML(self.html_code))
217
AttributeError: 'NBMasterBar' object has no attribute 'out'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
280 self.epoch=epoch; self('begin_epoch')
--> 281 self._do_epoch_train()
282 self._do_epoch_validate()
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in _do_epoch_train(self)
257 except CancelTrainException: self('after_cancel_train')
--> 258 finally: self('after_train')
259
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in __call__(self, event_name)
214
--> 215 def __call__(self, event_name): L(event_name).map(self._call_one)
216 def _call_one(self, event_name):
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in map(self, f, *args, **kwargs)
362 else f.__getitem__)
--> 363 return self._new(map(g, self))
364
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in _new(self, items, *args, **kwargs)
315 def _xtra(self): return None
--> 316 def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)
317 def __getitem__(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __call__(cls, x, *args, **kwargs)
41
---> 42 res = super().__call__(*((x,) + args), **kwargs)
43 res._newchk = 0
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __init__(self, items, use_list, match, *rest)
306 if (use_list is not None) or not _is_array(items):
--> 307 items = list(items) if use_list else _listify(items)
308 if match is not None:
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in _listify(o)
242 if isinstance(o, str) or _is_array(o): return [o]
--> 243 if is_iter(o): return list(o)
244 return [o]
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __call__(self, *args, **kwargs)
208 fargs = [args[x.i] if isinstance(x, _Arg) else x for x in self.pargs] + args[self.maxi+1:]
--> 209 return self.fn(*fargs, **kwargs)
210
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in _call_one(self, event_name)
217 assert hasattr(event, event_name)
--> 218 [cb(event_name) for cb in sort_by_run(self.cbs)]
219
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in <listcomp>(.0)
217 assert hasattr(event, event_name)
--> 218 [cb(event_name) for cb in sort_by_run(self.cbs)]
219
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in __call__(self, event_name)
20 "Call `self.{event_name}` if it's defined"
---> 21 if self.run: getattr(self, event_name, noop)()
22
/usr/local/lib/python3.6/dist-packages/fastai2/callback/progress.py in after_train(self)
27 def begin_validate(self): self._launch_pbar()
---> 28 def after_train(self): self.pbar.on_iter_end()
29 def after_validate(self): self.pbar.on_iter_end()
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __getattr__(self, k)
223 if attr is not None: return getattr(attr, k)
--> 224 raise AttributeError(k)
225 def __dir__(self): return custom_dir(self, self._dir() if self._xtra is None else self._dir())
AttributeError: pbar
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
<ipython-input-8-495233eaf2b4> in <module>()
----> 1 learn.fit_one_cycle(4)
/usr/local/lib/python3.6/dist-packages/fastai2/callback/schedule.py in fit_one_cycle(self, n_epoch, lr_max, div, div_final, pct_start, wd, moms, cbs, reset_opt)
96 scheds = {'lr': combined_cos(pct_start, lr_max/div, lr_max, lr_max/div_final),
97 'mom': combined_cos(pct_start, *moms)}
---> 98 self.fit(n_epoch, cbs=ParamScheduler(scheds)+L(cbs), reset_opt=reset_opt, wd=wd)
99
100 #Cell
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
285
286 except CancelFitException: self('after_cancel_fit')
--> 287 finally: self('after_fit')
288
289 def validate(self, ds_idx=1, dl=None, cbs=None):
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in __call__(self, event_name)
213 def ordered_cbs(self, cb_func:str): return [cb for cb in sort_by_run(self.cbs) if hasattr(cb, cb_func)]
214
--> 215 def __call__(self, event_name): L(event_name).map(self._call_one)
216 def _call_one(self, event_name):
217 assert hasattr(event, event_name)
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in map(self, f, *args, **kwargs)
361 else f.format if isinstance(f,str)
362 else f.__getitem__)
--> 363 return self._new(map(g, self))
364
365 def filter(self, f, negate=False, **kwargs):
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in _new(self, items, *args, **kwargs)
314 @property
315 def _xtra(self): return None
--> 316 def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)
317 def __getitem__(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
318 def copy(self): return self._new(self.items.copy())
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __call__(cls, x, *args, **kwargs)
40 return x
41
---> 42 res = super().__call__(*((x,) + args), **kwargs)
43 res._newchk = 0
44 return res
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __init__(self, items, use_list, match, *rest)
305 if items is None: items = []
306 if (use_list is not None) or not _is_array(items):
--> 307 items = list(items) if use_list else _listify(items)
308 if match is not None:
309 if is_coll(match): match = len(match)
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in _listify(o)
241 if isinstance(o, list): return o
242 if isinstance(o, str) or _is_array(o): return [o]
--> 243 if is_iter(o): return list(o)
244 return [o]
245
/usr/local/lib/python3.6/dist-packages/fastai2/core/foundation.py in __call__(self, *args, **kwargs)
207 if isinstance(v,_Arg): kwargs[k] = args.pop(v.i)
208 fargs = [args[x.i] if isinstance(x, _Arg) else x for x in self.pargs] + args[self.maxi+1:]
--> 209 return self.fn(*fargs, **kwargs)
210
211 #Cell
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in _call_one(self, event_name)
216 def _call_one(self, event_name):
217 assert hasattr(event, event_name)
--> 218 [cb(event_name) for cb in sort_by_run(self.cbs)]
219
220 def _bn_bias_state(self, with_bias): return bn_bias_params(self.model, with_bias).map(self.opt.state)
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in <listcomp>(.0)
216 def _call_one(self, event_name):
217 assert hasattr(event, event_name)
--> 218 [cb(event_name) for cb in sort_by_run(self.cbs)]
219
220 def _bn_bias_state(self, with_bias): return bn_bias_params(self.model, with_bias).map(self.opt.state)
/usr/local/lib/python3.6/dist-packages/fastai2/learner.py in __call__(self, event_name)
19 def __call__(self, event_name):
20 "Call `self.{event_name}` if it's defined"
---> 21 if self.run: getattr(self, event_name, noop)()
22
23 @property
/usr/local/lib/python3.6/dist-packages/fastai2/callback/progress.py in after_fit(self)
39 def after_fit(self):
40 if getattr(self, 'mbar', False):
---> 41 self.mbar.on_iter_end()
42 delattr(self, 'mbar')
43 self.learn.logger = self.old_logger
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in on_iter_end(self)
199 plt.close()
200 self.out2.update(self.fig)
--> 201 total_time = format_time(time() - self.start_t)
202 if self.text.endswith('<p>'): self.text = self.text[:-3]
203 if self.total_time: self.text = f'Total time: {total_time} <p>' + self.text
AttributeError: 'NBMasterBar' object has no attribute 'start_t'
I already tried upgrading fastprogress
but it was on the latest version. pip show
has version 0.1.21