Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No module named 'basicsr' #207

Open
KINGDOMWARE opened this issue Mar 21, 2024 · 1 comment
Open

No module named 'basicsr' #207

KINGDOMWARE opened this issue Mar 21, 2024 · 1 comment

Comments

@KINGDOMWARE
Copy link

Hello, got an issue

An exception occurred while trying to process the frame: No module named 'basicsr'
Traceback (most recent call last):
File "C:\stable-diffusion-portable-main\extensions\SD-CN-Animation\scripts\base_ui.py", line 146, in process
yield from txt2vid.start_process(*args)
File "C:\stable-diffusion-portable-main\extensions\SD-CN-Animation\scripts\core\txt2vid.py", line 139, in start_process
FloweR_load_model(size[0], size[1])
File "C:\stable-diffusion-portable-main\extensions\SD-CN-Animation\scripts\core\txt2vid.py", line 38, in FloweR_load_model
from basicsr.utils.download_util import load_file_from_url
ModuleNotFoundError: No module named 'basicsr'

What should I do?

@GitHub-Zho
Copy link

GitHub-Zho commented Apr 5, 2024

I have got the same problem.
Here is my solusion.

First download the 'basicsr' package on your own conda environment and try to import it,
you wil find some error like this

>>> from basicsr.utils.download_util import load_file_from_url
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\miniconda3\envs\stable-web\lib\site-packages\basicsr\__init__.py", line 4, in <module>
    from .data import *
  File "D:\miniconda3\envs\stable-web\lib\site-packages\basicsr\data\__init__.py", line 22, in <module>
    _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
  File "D:\miniconda3\envs\stable-web\lib\site-packages\basicsr\data\__init__.py", line 22, in <listcomp>
    _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
  File "D:\miniconda3\envs\stable-web\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "D:\miniconda3\envs\stable-web\lib\site-packages\basicsr\data\realesrgan_dataset.py", line 11, in <module>
    from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
  File "D:\miniconda3\envs\stable-web\lib\site-packages\basicsr\data\degradations.py", line 8, in <module>
    from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

Find the D:\miniconda3\envs\stable-web\lib\site-packages\basicsr\data\degradations.py under you conda env,
modify the from torchvision.transforms.functional_tensor import rgb_to_grayscale to
from torchvision.transforms.functional import rgb_to_grayscale

Later copy the "basicsr" and "basicsr-1.4.2.dist-info" folder
under "D:\miniconda3\envs\stable-web\lib\site-packages\" to your web-ui env site-packages
"stable-diffusion-webui\venv\Lib\site-packages".

Hope it can help.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants