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
Would you accept a PR where we add the v2 versions? My understanding is that it's a drop-in replacement and that everything should stay the same, but I'd double check.
The text was updated successfully, but these errors were encountered:
Hi, adding support for v2 transforms sounds like a great idea. As @IgorSusmelj mentioned, lightly still supports older torchvision versions that do not yet support v2 transforms. I would suggest to add the following at the top of lightly.transforms.__init__:
try:
# Use transforms v2 if available.
import torchvision.transforms.v2 as torchvision_transforms
except ImportError:
import torchvision.transforms as torchvision_transforms
And then replace code using the torchvision transforms in all files in lightly.transforms and lightly.collate:
# Replace this:
import torchvision.transforms as T
# With this:
import lightly.transforms.torchvision_transforms as T
This allows us to do the try/except check in a single place.
A PR would be very welcome (doesn't have to implement all the changes) :)
My understanding is that lightly uses the "old" v1 torchvision transforms, see e.g.
lightly/lightly/transforms/dino_transform.py
Line 4 in 8878b5b
The v1 transforms have some drawbacks:
litdata.StreamingDataset
)Would you accept a PR where we add the v2 versions? My understanding is that it's a drop-in replacement and that everything should stay the same, but I'd double check.
The text was updated successfully, but these errors were encountered: