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
I find that random.random() was replaced by torch.rand() in some of the random transforms (e.g. RandomHorizontalFlip) not in some others (e.g. RandomGrayscale).
I believe a lot of users rely on the previous random.random() behavior by manually seeding random to apply an identical transform to the image/segmentation/etc. See this highly upvoted (and thus copied and used) comment: #9 (comment)
Existing code will still train with inferior performance and it is hard to notice. This is kind of horrible.
If the change is inevitable, maybe it can at least be mentioned in the release note?
The text was updated successfully, but these errors were encountered:
This change is part of a larger change that we haven't yet finished for the 0.7.0 release, and for the next release all classes will use torch.rand() instead of random.random().
I agree we should have mentioned it more broadly in the release notes though, will make a note there.
There is unfortunately no way to avoid the change to random.random() for now (it is dependent on torchscript support for random, which is not available).
I will edit the comment you pointed out mentioning that we should now also seed torch.manual_seed in order for that behavior to work, but note that seeding the random seed in the __getitem__ is a fragile approach and I would definitely NOT recommend doing it. Instead, I would encourage using the functional interface, while we don't come up with a better proposal for this, see #1406.
I find that
random.random()
was replaced bytorch.rand()
in some of the random transforms (e.g. RandomHorizontalFlip) not in some others (e.g. RandomGrayscale).I believe a lot of users rely on the previous
random.random()
behavior by manually seedingrandom
to apply an identical transform to the image/segmentation/etc. See this highly upvoted (and thus copied and used) comment: #9 (comment)Existing code will still train with inferior performance and it is hard to notice. This is kind of horrible.
If the change is inevitable, maybe it can at least be mentioned in the release note?
The text was updated successfully, but these errors were encountered: