-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BREAKING FIX] [torchvision 0.17] Change functional_tensor import #650
[BREAKING FIX] [torchvision 0.17] Change functional_tensor import #650
Conversation
@@ -5,7 +5,7 @@ | |||
import torch | |||
from scipy import special | |||
from scipy.stats import multivariate_normal | |||
from torchvision.transforms.functional_tensor import rgb_to_grayscale | |||
from torchvision.transforms.functional import rgb_to_grayscale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would not be a breaking change if you try both imports:
from torchvision.transforms.functional import rgb_to_grayscale | |
try: | |
from torchvision.transforms.functional import rgb_to_grayscale | |
except ImportError: | |
from torchvision.transforms.functional_tensor import rgb_to_grayscale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will work--
try:
from torchvision.transforms.functional import rgb_to_grayscale
except ImportError:
from torchvision.transforms.functional_tensor import rgb_to_grayscale
|
can we merge it? 2 months since 0.17 released. |
Over at Invoke, we only use the RealESRGAN functionality provided by I extracted the relevant classes and cleaned them up a bit: Maybe this is useful for others who only use this library for upscaling and would like to keep their other dependencies up to date. |
The Spandrel project by the chaiNNer folks (disclaimer: I'm a contributor, and I also wired Spandrel up into a1111 in AUTOMATIC1111/stable-diffusion-webui#14425) implements RealESRGAN and various other upscaling and enhancement models in a clean way. |
Thanks for the link @akx ! This looks like a very ergonomic API, great work. Much nicer than what the basicsr repo provides (and my extracted version of it). |
change functional_tensor to functional (XPixelGroup#650)
could we release a new version with this fix? |
This bug continues to cause many users of downstream packages to manually hack up the basicsr code to get things to run, despite being fixed in Is it possible for whoever controls the PyPI packaging to push the build button and release a new version? |
Fix for #649