mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-04-29 09:13:08 +00:00
No module named 'basicsr.losses.gan_loss' #208
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 @wsysl1989 on GitHub (Jul 13, 2022).
D:\Python\python.exe N:/python/GFPGAN1.34/GFPGAN-master/inference_gfpgan.py
Traceback (most recent call last):
File "N:\python\GFPGAN1.34\GFPGAN-master\inference_gfpgan.py", line 9, in
from gfpgan import GFPGANer
File "N:\python\GFPGAN1.34\GFPGAN-master\gfpgan_init_.py", line 4, in
from .models import *
File "N:\python\GFPGAN1.34\GFPGAN-master\gfpgan\models_init_.py", line 10, in
model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
File "N:\python\GFPGAN1.34\GFPGAN-master\gfpgan\models_init.py", line 10, in
model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
File "D:\Python\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "N:\python\GFPGAN1.34\GFPGAN-master\gfpgan\models\gfpgan_model.py", line 6, in
from basicsr.losses.gan_loss import r1_penalty
ModuleNotFoundError: No module named 'basicsr.losses.gan_loss'
@tg-bomze commented on GitHub (Jul 13, 2022):
@xinntao commented on GitHub (Jul 13, 2022):
update basicsr to the latest version v1.4.0
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Denis Malimonov @.>
Sent: Wednesday, July 13, 2022 11:00:40 PM
To: TencentARC/GFPGAN @.>
Cc: Subscribed @.***>
Subject: Re: [TencentARC/GFPGAN] No module named 'basicsr.losses.gan_loss' (Issue #215)
git clone https://github.com/TencentARC/GFPGAN.git
cd GFPGAN
git checkout
bc3f0c4pip install basicsr==1.3.5
—
Reply to this email directly, view it on GitHubhttps://github.com/TencentARC/GFPGAN/issues/215#issuecomment-1183335332, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEFDHV6STNZ6YYFMT2LRFO3VT3KZRANCNFSM53PANWGQ.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
@yubohuangai commented on GitHub (Jul 26, 2022):
Still unsolved.
Installing collected packages: basicsr
Attempting uninstall: basicsr
Found existing installation: basicsr 1.3.5
Uninstalling basicsr-1.3.5:
Successfully uninstalled basicsr-1.3.5
Successfully installed basicsr-1.4.1
@Ir1d commented on GitHub (Aug 5, 2022):
downgrading from 1.4.1 to 1.3.5 works for me
@elen07zz commented on GitHub (Sep 13, 2022):
change GFPGAN-master\gfpgan\models\gfpgan_model.py
line: from basicsr.losses.gan_loss import r1_penalty
to
from basicsr.losses.losses import r1_penalty
@wsysl1989 commented on GitHub (Sep 13, 2022):
thanks,but another problem occurs,can not go on again.
Traceback (most recent call last):
File "N:\python\GFPGAN1.34\GFPGAN-master\inference_gfpgan.py", line 155, in
main()
File "N:\python\GFPGAN1.34\GFPGAN-master\inference_gfpgan.py", line 103, in main
restorer = GFPGANer(
File "N:\python\GFPGAN1.34\GFPGAN-master\gfpgan\utils.py", line 76, in init
self.face_helper = FaceRestoreHelper(
TypeError: init() got an unexpected keyword argument 'use_parse'
@DZai commented on GitHub (Sep 27, 2022):
update basicsr to the version v1.4.2, and update facexlib to 0.2.5 works for me. No need to change gfpgan_model.py
@wsysl1989 commented on GitHub (Sep 27, 2022):
thanks,update basicsr to the version v1.4.2, and update facexlib to 0.2.5 ,still change back " from basicsr.losses.gan_loss import r1_penalty".now,it works for me.
@LightningStalker commented on GitHub (Oct 16, 2022):
This also appears to work in stable-diffusion-krita-plugin though the py script is in a different location.
@wordsand commented on GitHub (Jan 24, 2024):
for my python 3.10.x and basicsr 1.4.2
change to : from basicsr.losses.gan_loss import r1_penalty
works for me.