Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

AttributeError: 'NBProgressBar' object has no attribute 'start_t'

Abierto
#72 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
jupyter-notebook, python
Área
tooling

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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AnswerDotAI/fastprogress

Todos los issues de AnswerDotAI/fastprogress

Issues similares

Más issues de DevTools

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.