Weakref tqdm

I run into the following error when i call learn.fit(lr, 1, cycle_len=1) and multiple rerun on the same line would fix it. Wondering what happen there.

Detail:

~/ml/fastai/courses/dl2/fastai/imports.py in clear_tqdm()
     41     inst = getattr(tq.tqdm, '_instances', None)
     42     if not inst: return
---> 43     for i in range(len(inst)): inst.pop().close()
     44 
     45 if in_notebook():

~/.local/lib/python3.6/site-packages/tqdm/_tqdm.py in close(self)
   1096         # decrement instance pos and remove from internal set
   1097         pos = abs(self.pos)
-> 1098         self._decr_instances(self)
   1099 
   1100         # GUI mode

~/.local/lib/python3.6/site-packages/tqdm/_tqdm.py in _decr_instances(cls, instance)
    436         with cls._lock:
    437             try:
--> 438                 cls._instances.remove(instance)
    439             except KeyError:
    440                 if not instance.gui:  # pragma: no cover

~/anaconda2/envs/fastai/lib/python3.6/_weakrefset.py in remove(self, item)
    107         if self._pending_removals:
    108             self._commit_removals()
--> 109         self.data.remove(ref(item))
    110 
    111     def discard(self, item):

KeyError: <weakref at 0x7f654ad17cc8; to 'tqdm' at 0x7f654ad23e48>
2 Likes

reinstalled fast ai fixed it. thanks.

2 Likes

I observed the same thing (using git commit e2415fe7364ef9a2b911cbf09114cd721ca2502e from April 18, 2018).

1 Like

Iā€™m getting this same error when using crestle. Is there anyway to reinstall fast ai with crestle or any other way to fix this?
Thanks