You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide a minimal reproduceable code with PyTorch and easydict package versions, or people cannot understand your problem, nor do answer.
I suspect this issue relates to the Python 3 implementation of dict.keys().
In Python 3, dict.keys() returns a view object, while in Python 2 it returns a copy of keys. A view object is similar to a real-time dynamic view of the original object (dictionary in this case). It is an undefined behavior to iterate over a view object (iterator) modified in the flight, and thus causes an RuntimeError.
To enforce the Python 2 behavior, you need to either convert the view object to a list list(dict.keys()) or modify a copy of the original dictionary like this (see the last code block).
Suppose that your attached code is the EasyDictinitializer. Could you modify the line 143 from for k in self.__class__.__dict__.keys(): to for k in list(self.__class__.__dict__.keys()):, and see if the error persists?
pytorch ddp mode, dataloader wrapper batch data by EasyDict.
line 120, in init for k in self.class.dict.keys():
The text was updated successfully, but these errors were encountered: