in Windows AssertionError: An object named 'ResNetArcFace' was already registered in 'arch' registry! #169

Open
opened 2026-01-29 21:44:46 +00:00 by claunia · 2 comments
Owner

Originally created by @Mehrancd on GitHub (Mar 2, 2022).

runfile('../GFPGAN/inference_gfpgan.py', args='-i inputs/whole_imgs -o results -v 1.3 -s 2', wdir='../GFPGAN')
Traceback (most recent call last):

File "..\GFPGAN\inference_gfpgan.py", line 9, in
from gfpgan import GFPGANer

File "..\GFPGAN\gfpgan_init_.py", line 2, in
from .archs import *

File "..\GFPGAN\gfpgan\archs_init_.py", line 10, in
_arch_modules = [importlib.import_module(f'gfpgan.archs.{file_name}') for file_name in arch_filenames]

File "..\GFPGAN\gfpgan\archs_init_.py", line 10, in
_arch_modules = [importlib.import_module(f'gfpgan.archs.{file_name}') for file_name in arch_filenames]

File "..\anaconda3\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "..\GFPGAN\gfpgan\archs\arcface_arch.py", line 172, in
class ResNetArcFace(nn.Module):

File "..\anaconda3\lib\site-packages\basicsr\utils\registry.py", line 53, in deco
self._do_register(name, func_or_class)

File "..\anaconda3\lib\site-packages\basicsr\utils\registry.py", line 39, in _do_register
assert (name not in self._obj_map), (f"An object named '{name}' was already registered "

AssertionError: An object named 'ResNetArcFace' was already registered in 'arch' registry!

Originally created by @Mehrancd on GitHub (Mar 2, 2022). runfile('../GFPGAN/inference_gfpgan.py', args='-i inputs/whole_imgs -o results -v 1.3 -s 2', wdir='../GFPGAN') Traceback (most recent call last): File "..\GFPGAN\inference_gfpgan.py", line 9, in <module> from gfpgan import GFPGANer File "..\GFPGAN\gfpgan\__init__.py", line 2, in <module> from .archs import * File "..\GFPGAN\gfpgan\archs\__init__.py", line 10, in <module> _arch_modules = [importlib.import_module(f'gfpgan.archs.{file_name}') for file_name in arch_filenames] File "..\GFPGAN\gfpgan\archs\__init__.py", line 10, in <listcomp> _arch_modules = [importlib.import_module(f'gfpgan.archs.{file_name}') for file_name in arch_filenames] File "..\anaconda3\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "..\GFPGAN\gfpgan\archs\arcface_arch.py", line 172, in <module> class ResNetArcFace(nn.Module): File "..\anaconda3\lib\site-packages\basicsr\utils\registry.py", line 53, in deco self._do_register(name, func_or_class) File "..\anaconda3\lib\site-packages\basicsr\utils\registry.py", line 39, in _do_register assert (name not in self._obj_map), (f"An object named '{name}' was already registered " AssertionError: An object named 'ResNetArcFace' was already registered in 'arch' registry!
Author
Owner

@tengshaofeng commented on GitHub (Jan 18, 2023):

It is because of the conflict of local basicsr and package installed. So you can change the order of sys.path of local basicsr and site-packages

@tengshaofeng commented on GitHub (Jan 18, 2023): It is because of the conflict of local basicsr and package installed. So you can change the order of sys.path of local basicsr and site-packages
Author
Owner

@bring-nirachornkul commented on GitHub (Feb 10, 2023):

how can change the order of sys.path of local basicsr and site-packages?
Which item or site-packages need to come first and last?

It is because of the conflict of local basicsr and package installed. So you can change the order of sys.path of local basicsr and site-packages

@bring-nirachornkul commented on GitHub (Feb 10, 2023): how can change the order of sys.path of local basicsr and site-packages? Which item or site-packages need to come first and last? > It is because of the conflict of local basicsr and package installed. So you can change the order of sys.path of local basicsr and site-packages
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#169