AttributeError: 'NBProgressBar' object has no attribute 'start_t'
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
Direzione di ricerca
Inizia con il notebook fastbook collegato e la chiamata a NBProgressBar.update mostrata nel traceback di fastprogress.py. Riproduci il malfunzionamento in learn.tta(), quindi esamina il ciclo di vita della barra di avanzamento in relazione all'attributo start_t mancante. Il lavoro è completato quando il notebook termina quella chiamata senza l'AttributeError e la visualizzazione dell'avanzamento continua a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I meet error as follows:
https://github.com/fastai/fastbook/blob/master/07_sizing_and_tta.ipynb
I did also follows
pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
from fastbook import *
But error occured as follows :
preds,targs = learn.tta()
accuracy(preds, targs).item()
| epoch | train_loss | valid_loss | accuracy | time |
|---|
AttributeError Traceback (most recent call last)
in
----> 1 preds,targs = learn.tta()
2 accuracy(preds, targs).item()
/opt/conda/lib/python3.7/site-packages/fastai/learner.py in tta(self, ds_idx, dl, n, item_tfms, batch_tfms, beta, use_max)
566 if item_tfms is not None or batch_tfms is not None: dl = dl.new(after_item=item_tfms, after_batch=batch_tfms)
567 try:
--> 568 self(_before_epoch)
569 with dl.dataset.set_split_idx(0), self.no_mbar():
570 if hasattr(self,'progress'): self.progress.mbar = master_bar(list(range(n)))
/opt/conda/lib/python3.7/site-packages/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):
/opt/conda/lib/python3.7/site-packages/fastcore/foundation.py in map(self, f, *args, **kwargs)
270 else f.format if isinstance(f,str)
271 else f.getitem)
--> 272 return self._new(map(g, self))
273
274 def filter(self, f, negate=False, **kwargs):
/opt/conda/lib/python3.7/site-packages/fastcore/foundation.py in _new(self, items, *args, **kwargs)
216 @property
217 def _xtra(self): return None
--> 218 def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)
219 def getitem(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
220 def copy(self): return self._new(self.items.copy())
/opt/conda/lib/python3.7/site-packages/fastcore/foundation.py in call(cls, x, *args, **kwargs)
197 def call(cls, x=None, *args, **kwargs):
198 if not args and not kwargs and x is not None and isinstance(x,cls): return x
--> 199 return super().call(x, *args, **kwargs)
200
201 # Cell
/opt/conda/lib/python3.7/site-packages/fastcore/foundation.py in init(self, items, use_list, match, *rest)
207 if items is None: items = []
208 if (use_list is not None) or not _is_array(items):
--> 209 items = list(items) if use_list else _listify(items)
210 if match is not None:
211 if is_coll(match): match = len(match)
/opt/conda/lib/python3.7/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
/opt/conda/lib/python3.7/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
/opt/conda/lib/python3.7/site-packages/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)
/opt/conda/lib/python3.7/site-packages/fastai/learner.py in (.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)
/opt/conda/lib/python3.7/site-packages/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
/opt/conda/lib/python3.7/site-packages/fastai/callback/progress.py in before_epoch(self)
21
22 def before_epoch(self):
---> 23 if getattr(self, 'mbar', False): self.mbar.update(self.epoch)
24
25 def before_train(self): self._launch_pbar()
/opt/conda/lib/python3.7/site-packages/fastprogress/fastprogress.py in update(self, val)
92 yield o
93
---> 94 def update(self, val): self.main_bar.update(val)
95
96 # Cell
/opt/conda/lib/python3.7/site-packages/fastprogress/fastprogress.py in update(self, val)
57 elif val <= self.first_its or val >= self.last_v + self.wait_for or val >= self.total:
58 cur_t = time.time()
---> 59 avg_t = (cur_t - self.start_t) / val
60 self.wait_for = max(int(self.update_every / (avg_t+1e-8)),1)
61 self.pred_t = avg_t * self.total
AttributeError: 'NBProgressBar' object has no attribute 'start_t'
Please. fix it correctly or reply how to avoid these error.
- Lingua principale
- Jupyter Notebook
- Stelle
- 1.1k
- Fork
- 103
- Merge medio
- 1m
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AnswerDotAI/fastprogress
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
AnswerDotAI/fastprogress#124 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
AnswerDotAI/fastprogress#121 · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
AnswerDotAI/fastprogress#117 · 4 commenti · 12 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
AnswerDotAI/fastprogress#111 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
AnswerDotAI/fastprogress#107 ·
Tutte le issue di AnswerDotAI/fastprogress
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 commento ·
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 commento ·
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Automattic/blocks-engine#2161 ·