TypeError: DataLoaderIterWrapper object is not an iterator ?
See original GitHub issueclass DataLoaderIterWrapper(object):
def __init__(self, data_loader, auto_reset=True):
self.data_loader = data_loader
self.auto_reset = auto_reset
self._iterator = iter(data_loader)
def __next__(self):
# Get a new set of inputs and labels
try:
# inputs, labels, *_ = next(self._iterator)
inputs, labels = next(self._iterator)
except StopIteration:
if not self.auto_reset:
raise
self._iterator = iter(self.data_loader)
# inputs, labels, *_ = next(self._iterator)
inputs, labels = next(self._iterator)
return inputs, labels
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
TypeError: 'list' object is not an iterator in Python | bobbyhadz
The Python TypeError: 'list' object is not an iterator occurs when we try to use a list as an iterator. To solve the...
Read more >Why is an iterable object not an iterator? - Stack Overflow
The iter() function raises a TypeError if the passed in value doesn't support the iter() method or the sequence protocol (the getitem() method)....
Read more >Dataset object is not an iterator, although I can iterate on it.
TypeError : 'DatasetV1Adapter' object is not an iterator. Describe the expected behavior: Should fetch the first element of the iterator, ...
Read more >How To Fix Type Error: List Object is Not an Iterator - YouTube
Are you here trying to understand how to fix type error : list object is not an iterator ? Here we explain how...
Read more >Symbol.iterator - JavaScript - MDN Web Docs
Whenever an object needs to be iterated (such as at the beginning of a for...of loop), its @@iterator method is called with no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As @NaleRaphael said we dropped support for Py2k recently. However, the last release was left in a broken state for Py2k so it’s only fair that it gets fixed. I released version 0.1.5 which fixes the extended iterable unpacking meaning that you shouldn’t have to comment-out those lines and further change the code to make it work.
Give it a try, it’s currently the latest version on PyPI so you can simply do
pip install torch-lr-finder
.I also created a branch with the latest code that works on Py2k: torch_lr_finder-v0.1.
Let us know if you have any problems with the latest version
Closing this, feel free to reopen if you find a problem related to this