mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-02-14 13:24:36 +00:00
torchvision.transforms.functional_tensor import rgb_to_grayscale #451
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @misssunitaparker on GitHub (Feb 6, 2024).
Traceback (most recent call last):
File "E:\SOFT\GFPGAN\GFPGAN\inference_gfpgan.py", line 7, in
from basicsr.utils import imwrite
File "C:\Users\MKN\anaconda3\Lib\site-packages\basicsr_init_.py", line 4, in
from .data import *
File "C:\Users\MKN\anaconda3\Lib\site-packages\basicsr\data_init_.py", line 22, in
dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MKN\anaconda3\Lib\site-packages\basicsr\data_init.py", line 22, in
dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MKN\anaconda3\Lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MKN\anaconda3\Lib\site-packages\basicsr\data\realesrgan_dataset.py", line 11, in
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File "C:\Users\MKN\anaconda3\Lib\site-packages\basicsr\data\degradations.py", line 8, in
from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'
@vltmedia commented on GitHub (Feb 7, 2024):
I'm guessing for the time being you may need to check and downgrade your
torchvisionversion.I've been noticing this deprecation warning with
torchvision 0.16.2+cu118but it is still working and processing properly:@MinasFakhori commented on GitHub (Feb 15, 2024):
I have forked the basicsr repo and updated the import to make it work, to use it you have to:
Install it
pip install new-basicsrChange the requirements.txt from:
basicsr>=1.4.2tonew-basicsrUninstall the old basicsr
pip uninstall basicsrReinstall
requirements.txtHope that helps :)
@misssunitaparker commented on GitHub (Feb 17, 2024):
not solve this problem
@vltmedia commented on GitHub (Feb 17, 2024):
Just tried it on 3 environments and OS and it does work on a fresh environment with my torchvision fix....
The error literally points to torchvision...
@tzktz commented on GitHub (Feb 20, 2024):
Change in degradations.py file..
from
to
Now that will be wrks fine 👍
@yz3358 commented on GitHub (Sep 11, 2024):
Thanks! This works well for me. I've been trapped by this dependency issue for a few hours (python newbie here :P)
@misssunitaparker commented on GitHub (Sep 16, 2024):
thank you for your response.
On Wed, 11 Sept 2024 at 11:08, yz3358 @.***> wrote: