Skip to content

AttributeError: monitor with tqdm_notebook #338

@elbamos

Description

@elbamos

I'm seeing this after the last batch of an interator:

/mnt/data2/anaconda3/envs/pytorch/lib/python3.5/site-packages/tqdm/_tqdm_notebook.py in __iter__(self, *args, **kwargs)
    185     def __iter__(self, *args, **kwargs):
    186         try:
--> 187             for obj in super(tqdm_notebook, self).__iter__(*args, **kwargs):
    188                 # return super(tqdm...) will not catch exception
    189                 yield obj

/mnt/data2/anaconda3/envs/pytorch/lib/python3.5/site-packages/tqdm/_tqdm.py in __iter__(self)
    899             self.n = n
    900             self.miniters = miniters
--> 901             self.close()
    902 
    903     def update(self, n=1):

/mnt/data2/anaconda3/envs/pytorch/lib/python3.5/site-packages/tqdm/_tqdm_notebook.py in close(self, *args, **kwargs)
    203 
    204     def close(self, *args, **kwargs):
--> 205         super(tqdm_notebook, self).close(*args, **kwargs)
    206         # If it was not run in a notebook, sp is not assigned, check for it
    207         if hasattr(self, 'sp'):

/mnt/data2/anaconda3/envs/pytorch/lib/python3.5/site-packages/tqdm/_tqdm.py in close(self)
   1000         # decrement instance pos and remove from internal set
   1001         pos = self.pos
-> 1002         self._decr_instances(self)
   1003 
   1004         # GUI mode

/mnt/data2/anaconda3/envs/pytorch/lib/python3.5/site-packages/tqdm/_tqdm.py in _decr_instances(cls, instance)
    410             if not cls._instances and cls.monitor:
    411                 cls.monitor.exit()
--> 412                 del cls.monitor
    413                 cls.monitor = None
    414         except KeyError:

AttributeError: monitor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions