No module named 'basicsr.losses.losses' #205

Open
opened 2026-01-29 21:45:41 +00:00 by claunia · 4 comments
Owner

Originally created by @Sid-XXD on GitHub (Jul 13, 2022).

thanks for your great work. Here I got some problem when I try to run GFPGAN. I have followed the steps to successfully complete all the requirements, but here comes a ERROR. Please give some help, thank you very much.

➜ GFPGAN git:(master) ✗ python inference_gfpgan.py -i /root/cloud/cephfs-group-internship/light_image_to_image/dataset/xxd_celeba/random_GFPGAN -o results -v 1.3 -s 2
Traceback (most recent call last):
File "inference_gfpgan.py", line 9, in
from gfpgan import GFPGANer
File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/init.py", line 4, in
from .models import *
File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/models/init.py", line 10, in
_model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/models/init.py", line 10, in
_model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
File "/opt/conda/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/models/gfpgan_model.py", line 6, in
from basicsr.losses.losses import r1_penalty
ModuleNotFoundError: No module named 'basicsr.losses.losses'

Originally created by @Sid-XXD on GitHub (Jul 13, 2022). thanks for your great work. Here I got some problem when I try to run GFPGAN. I have followed the steps to successfully complete all the requirements, but here comes a ERROR. Please give some help, thank you very much. ➜ GFPGAN git:(master) ✗ python inference_gfpgan.py -i /root/cloud/cephfs-group-internship/light_image_to_image/dataset/xxd_celeba/random_GFPGAN -o results -v 1.3 -s 2 Traceback (most recent call last): File "inference_gfpgan.py", line 9, in <module> from gfpgan import GFPGANer File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/__init__.py", line 4, in <module> from .models import * File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/models/__init__.py", line 10, in <module> _model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames] File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/models/__init__.py", line 10, in <listcomp> _model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames] File "/opt/conda/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/root/picasso/XXD/compareModel/TencentARC_GFPGAN/GFPGAN/gfpgan/models/gfpgan_model.py", line 6, in <module> from basicsr.losses.losses import r1_penalty ModuleNotFoundError: No module named 'basicsr.losses.losses'
Author
Owner

@towerlina commented on GitHub (Aug 23, 2022):

downgrading from 1.4.1 to 1.3.5 works for me

@towerlina commented on GitHub (Aug 23, 2022): downgrading from 1.4.1 to 1.3.5 works for me
Author
Owner

@Sid-XXD commented on GitHub (Aug 24, 2022):

downgrading from 1.4.1 to 1.3.5 works for me

thanks, it is works for me :)

@Sid-XXD commented on GitHub (Aug 24, 2022): > downgrading from 1.4.1 to 1.3.5 works for me thanks, it is works for me :)
Author
Owner

@pana8888 commented on GitHub (Sep 14, 2022):

same problem, sorry, which module should be downgrade?

@pana8888 commented on GitHub (Sep 14, 2022): same problem, sorry, which module should be downgrade?
Author
Owner

@elen07zz commented on GitHub (Sep 15, 2022):

same problem, sorry, which module should be downgrade?

basicsr

@elen07zz commented on GitHub (Sep 15, 2022): > same problem, sorry, which module should be downgrade? basicsr
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#205