From 28dc1d9adc0f3a1b2712e24502a9ff55df523700 Mon Sep 17 00:00:00 2001 From: SPARSH MEHTA <69897673+sipsmehta@users.noreply.github.com> Date: Wed, 1 May 2024 17:04:02 +0530 Subject: [PATCH] Fix import error for rgb_to_grayscale The import statement for rgb_to_grayscale was referencing the torchvision.transforms.functional_tensor module, which is not available in the current version of torchvision. Updated the import statement to use torchvision.transforms.functional instead, resolving the ModuleNotFoundError. This commit fixes the issue where the script was failing to run due to the missing module. The change ensures compatibility with the installed version of torchvision and allows the script to execute successfully. --- basicsr/data/degradations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basicsr/data/degradations.py b/basicsr/data/degradations.py index 4fa20d4a0..14319605d 100644 --- a/basicsr/data/degradations.py +++ b/basicsr/data/degradations.py @@ -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 # -------------------------------------------------------------------- # # --------------------------- blur kernels --------------------------- #