Iterator error after pip install
See original GitHub issueHello,
Thanks so much for an awesome package!😃
I recently re-pip installed plbolts on a google colab notebook. My code worked before. I’m trying to train a DQN.
On importing the DQN (from pl_bolts.models.rl import DQN), I get the following error:
/usr/local/lib/python3.7/dist-packages/torch/utils/data/_typing.py in _dp_init_subclass(sub_cls, *args, **kwargs)
369 return_hint.__origin__ == collections.abc.Iterator)):
370 raise TypeError("Expected 'Iterator' as the return annotation for `__iter__` of {}"
--> 371 ", but found {}".format(sub_cls.__name__, _type_repr(hints['return'])))
372 data_type = return_hint.__args__[0]
373 if not issubtype(data_type, sub_cls.type.param):
TypeError: Expected 'Iterator' as the return annotation for `__iter__` of ExperienceSourceDataset, but found typing.Iterable
Help would be appreciated!
Thank you:-)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
ImportError after successful pip installation [duplicate]
I have successfully installed a library with pip install <library-name> . But when I try to import it, python raises ImportError: No module ......
Read more >trying to import iterator from collections with python 3.10 for az ml
Describe the bug Get the following error when trying to submit a training script to the remote computer cluster via az ml cannot...
Read more >Built-in Functions — Python 3.11.1 documentation
Return an asynchronous iterator for an asynchronous iterable. Equivalent to calling x.__aiter__() . Note: Unlike iter() , aiter() ...
Read more >Iterators in Python - GeeksforGeeks
Iterator in Python is an object that is used to iterate over iterable objects like lists, tuples, dicts, and sets. The iterator object...
Read more >Python Iterators - W3Schools
Python Iterators. An iterator is an object that contains a countable number of values. An iterator is an object that can be iterated...
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 Free
Top 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

I found that installing the latest version from the Master branch fixes the import problem (no guarantees, though, that it wouldn’t break something else…):
pip install git+https://github.com/PytorchLightning/lightning-bolts.git@master --upgradeYep, I was also working in Colab. The funny thing is that some time before the code worked.