Skip to content
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

ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor' #711

Open
123kaya opened this issue Nov 24, 2024 · 2 comments

Comments

@123kaya
Copy link

123kaya commented Nov 24, 2024

I have checked every requested packages,the packages are fine, while the problem still exit.

the following is detail:

python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance
Traceback (most recent call last):
File "/home/djw/Python/real_esrgen/Real-ESRGAN/inference_realesrgan.py", line 5, in
from basicsr.archs.rrdbnet_arch import RRDBNet
File "/home/djw/Python/conda3/envs/myenv/lib/python3.12/site-packages/basicsr/init.py", line 4, in
from .data import *
File "/home/djw/Python/conda3/envs/myenv/lib/python3.12/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 "/home/djw/Python/conda3/envs/myenv/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/djw/Python/conda3/envs/myenv/lib/python3.12/site-packages/basicsr/data/realesrgan_dataset.py", line 11, in
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File "/home/djw/Python/conda3/envs/myenv/lib/python3.12/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'

@zq981604786
Copy link

@14790897
Copy link

I released a fixed version to address this issue. Use pip install basicsr-fixed instead of pip install basicsr.

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

No branches or pull requests

3 participants