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

not running #589

Open
mkn1212 opened this issue Oct 24, 2024 · 2 comments
Open

not running #589

mkn1212 opened this issue Oct 24, 2024 · 2 comments

Comments

@mkn1212
Copy link

mkn1212 commented Oct 24, 2024

python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.4 -s 2
Traceback (most recent call last):
File "/home/MKN/GFPGAN/inference_gfpgan.py", line 7, in
from basicsr.utils import imwrite
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/init.py", line 4, in
from .data import *
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/init.py", line 22, in
_dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/realesrgan_dataset.py", line 11, in
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/degradations.py", line 8, in
from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.4 -s 2
Traceback (most recent call last):
File "/home/MKN/GFPGAN/inference_gfpgan.py", line 7, in
from basicsr.utils import imwrite
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/init.py", line 4, in
from .data import *
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/init.py", line 22, in
_dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/realesrgan_dataset.py", line 11, in
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/degradations.py", line 8, in
from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

@Wh0ru
Copy link

Wh0ru commented Oct 25, 2024

python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.4 -s 2 Traceback (most recent call last): File "/home/MKN/GFPGAN/inference_gfpgan.py", line 7, in from basicsr.utils import imwrite File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/init.py", line 4, in from .data import * File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/init.py", line 22, in _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/realesrgan_dataset.py", line 11, in from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/degradations.py", line 8, in from torchvision.transforms.functional_tensor import rgb_to_grayscale ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.4 -s 2 Traceback (most recent call last): File "/home/MKN/GFPGAN/inference_gfpgan.py", line 7, in from basicsr.utils import imwrite File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/init.py", line 4, in from .data import * File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/init.py", line 22, in _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/realesrgan_dataset.py", line 11, in from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels File "/home/MKN/GFPGAN/myenv/lib/python3.12/site-packages/basicsr-1.4.2-py3.12.egg/basicsr/data/degradations.py", line 8, in from torchvision.transforms.functional_tensor import rgb_to_grayscale ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

you can try change “from torchvision.transforms.functional_tensor import rgb_to_grayscale” to “from torchvision.transforms.functional import rgb_to_grayscale”

@Volcanes
Copy link

Volcanes commented Oct 30, 2024

Use the following requirements.txt. I've checked the release date of GFPGAN and downloaded the similar date modules. In my conda env already worked:
basicsr==1.4.2
facexlib==0.2.5
lmdb==1.3.0
numpy==1.23.0
opencv-python==4.6.0.66
pyyaml==6.0
scipy==1.9.0rc1
tb-nightly==2.10.0a20220618
torch==1.11.0
torchvision==0.12.0
tqdm==4.64.0
yapf==0.32.0
scikit-image==0.19.3
pillow==9.1.1

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