Skip to content

Conversation

@EnriqueGlv
Copy link

Several issues were complaining about a NotImplementedError raised by torchvision.transforms.v2.Transform.transform.

The reason of this issue is that torchvision>=0.21 renamed the method that needs to be overridden when creating a custom transform. (see https://pytorch.org/vision/stable/generated/torchvision.transforms.v2.Transform.html#torchvision.transforms.v2.Transform.transform )

To fix this issue without breaking the support of older torchvision versions, I simply duplicated the methods "_transform" of the custom transforms and renamed them "transform".

@jerrytyf
Copy link

jerrytyf commented Jul 7, 2025

I found there are many "def _transform". did you mean that I should modify each of them under your guidance?

@1yuyin1
Copy link

1yuyin1 commented Jul 8, 2025

I found there are many "def _transform". did you mean that I should modify each of them under your guidance?

#104 have more detail, see files changed ,just one file need to modify,and in torchvision 0.22.1 is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants