New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyTorch 1.9 Compatibility: IterableDataset Type Annotations #235
Comments
Just tested the EnvDataset class itself and it should not break anything. Please correct me if I am wrong, I didn't find any subclass of EnvDataset in your repo. D |
Oh my mistake, I meant subclasses of Indeed this example doesn't have any errors! I'm pretty sure this issue isn't that hard to fix, I probably need to make sure all the |
I see. I have a super simple fix for you, remove the bound for Sequoia/sequoia/common/gym_wrappers/utils.py Line 220 in 517ccd2
It's true that it is too hard to figure out without context. For example of Sequoia/sequoia/settings/sl/wrappers/measure_performance.py Lines 32 to 36 in fc767ee
It inherits MeasurePerformanceWrapper . And, you can find you have specified the type is EnvType with bound of gym.env as shown below.Sequoia/sequoia/common/gym_wrappers/measure_performance.py Lines 13 to 14 in fc767ee
We just introduced a hard check for the return type of __iter__ in 1.9. But, you just specified the return type as below, which is not a subtype of your EnvType IMO. So, the Error raises.
But, I agree this check may be too strict. I may try to release the check for iterator in the next release. Thank you for your feedback! BTW, during my testing, I did find some interesting part like: Sequoia/sequoia/settings/rl/continual/environment.py Lines 80 to 82 in 84c35e6
The GymDataLoader is inheriting both DataLoader and IterableDataset , which is kind unexpected even though it doesn't break anything.
|
Hey @lebrice , Since it's been a while, just want to follow up if there is any other concern about it? |
@ejguan Hey! No its all good, I just havent taken the time to do it. I'll probably get this sorted out soon though. Thanks again! |
Creating this issue as a follow-up to the discussion with @ejguan on the closed PR #233 :
PyTorch 1.9 checks the type annotations on the IterableDataset subclasses. This is currently causing issues with the annotations of the various subclasses of Sequoia's
EnvDataset
class, which inherits fromIterableDataset
.This
EnvDataset
class can be found here, but here is a simple version of what it is meant to be like:Note: The actual
EnvDataset
class is a bit different from this, and doesn't use a generator, but this is just to illustrate the kind of interaction we have withIterableDataset
:The text was updated successfully, but these errors were encountered: