AttributeError: 'NBProgressBar' object has no attribute 'start_t'
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
Comienza con el notebook de fastbook enlazado y la llamada a NBProgressBar.update mostrada en el traceback de fastprogress.py. Reproduce el fallo en learn.tta() y, después, inspecciona el ciclo de vida de la barra de progreso alrededor del atributo start_t ausente. Se considera completado cuando el notebook termina esa llamada sin el AttributeError y la visualización del progreso sigue funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 1.1k
- Forks
- 103
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AnswerDotAI/fastprogress
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
AnswerDotAI/fastprogress#124 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
AnswerDotAI/fastprogress#121 · 2 reacciones ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
AnswerDotAI/fastprogress#117 · 4 comentarios · 12 reacciones ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
AnswerDotAI/fastprogress#111 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
AnswerDotAI/fastprogress#107 ·
Todos los issues de AnswerDotAI/fastprogress
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
ScoopInstaller/Extras#18940 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
prime-radiant-inc/evener#3873 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mathworks/MATLAB-extension-for-vscode#354 · 1 comentario ·
-
install.sh race conditionAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
VictorTaelin/OptMem#21 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
micromatch/picomatch#223 ·
Los mantenedores suelen responder en 11 días