ModuleNotFoundError: basicsr #332

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

Originally created by @numanashraf on GitHub (Apr 4, 2023).

ON Running : !torchrun --nproc_per_node=1 --master_port=22022 tests/test_gfpgan_model.py -opt tests/data/test_gfpgan_model.yml --launcher pytorch

with: !pip install basicsr==1.4.2
!pip install facexlib==0.2.5

Error is: ModuleNotFoundError: No module named 'basicsr.losses.losses'

/usr/local/lib/python3.9/dist-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be removed in 0.17. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
warnings.warn(
Traceback (most recent call last):
File "/content/drive/MyDrive/GFPGAN-master/tests/test_gfpgan_model.py", line 6, in
from basicsr.losses.losses import GANLoss, L1Loss, PerceptualLoss
ModuleNotFoundError: No module named 'basicsr.losses.losses'
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 2635) of binary: /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/bin/torchrun", line 33, in
sys.exit(load_entry_point('torch', 'console_scripts', 'torchrun')())
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 346, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 794, in main
run(args)
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 785, in run
elastic_launch(
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 134, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 250, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

tests/test_gfpgan_model.py FAILED

Failures:
<NO_OTHER_FAILURES>

Root Cause (first observed failure):
[0]:
time : 2023-04-04_15:34:05
host : ebde7a4ebafa
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 2635)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

with: !pip install basicsr==1.3.5

Error is: ModuleNotFoundError: No module named 'basicsr.losses.gan_loss'

/usr/local/lib/python3.9/dist-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be removed in 0.17. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
warnings.warn(
Traceback (most recent call last):
File "/content/drive/MyDrive/GFPGAN-master/tests/test_gfpgan_model.py", line 9, in
from gfpgan.archs.arcface_arch import ResNetArcFace
File "/usr/local/lib/python3.9/dist-packages/gfpgan/init.py", line 4, in
from .models import *
File "/usr/local/lib/python3.9/dist-packages/gfpgan/models/init.py", line 10, in
_model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
File "/usr/local/lib/python3.9/dist-packages/gfpgan/models/init.py", line 10, in
_model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.9/dist-packages/gfpgan/models/gfpgan_model.py", line 6, in
from basicsr.losses.gan_loss import r1_penalty
ModuleNotFoundError: No module named 'basicsr.losses.gan_loss'
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 3906) of binary: /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/bin/torchrun", line 33, in
sys.exit(load_entry_point('torch', 'console_scripts', 'torchrun')())
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 346, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 794, in main
run(args)
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 785, in run
elastic_launch(
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 134, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 250, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

tests/test_gfpgan_model.py FAILED

Failures:
<NO_OTHER_FAILURES>

Root Cause (first observed failure):
[0]:
time : 2023-04-04_15:38:24
host : ebde7a4ebafa
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 3906)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

Originally created by @numanashraf on GitHub (Apr 4, 2023). ON Running : !torchrun --nproc_per_node=1 --master_port=22022 tests/test_gfpgan_model.py -opt tests/data/test_gfpgan_model.yml --launcher pytorch with: !pip install basicsr==1.4.2 !pip install facexlib==0.2.5 Error is: ModuleNotFoundError: No module named 'basicsr.losses.losses' /usr/local/lib/python3.9/dist-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be **removed in 0.17**. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional. warnings.warn( Traceback (most recent call last): File "/content/drive/MyDrive/GFPGAN-master/tests/test_gfpgan_model.py", line 6, in <module> from basicsr.losses.losses import GANLoss, L1Loss, PerceptualLoss ModuleNotFoundError: No module named 'basicsr.losses.losses' ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 2635) of binary: /usr/bin/python3 Traceback (most recent call last): File "/usr/local/bin/torchrun", line 33, in <module> sys.exit(load_entry_point('torch', 'console_scripts', 'torchrun')()) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 794, in main run(args) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 785, in run elastic_launch( File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 134, in __call__ return launch_agent(self._config, self._entrypoint, list(args)) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 250, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ tests/test_gfpgan_model.py FAILED ------------------------------------------------------------ Failures: <NO_OTHER_FAILURES> ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2023-04-04_15:34:05 host : ebde7a4ebafa rank : 0 (local_rank: 0) exitcode : 1 (pid: 2635) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================ with: !pip install basicsr==1.3.5 Error is: ModuleNotFoundError: No module named 'basicsr.losses.gan_loss' /usr/local/lib/python3.9/dist-packages/torchvision/transforms/functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be **removed in 0.17**. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional. warnings.warn( Traceback (most recent call last): File "/content/drive/MyDrive/GFPGAN-master/tests/test_gfpgan_model.py", line 9, in <module> from gfpgan.archs.arcface_arch import ResNetArcFace File "/usr/local/lib/python3.9/dist-packages/gfpgan/__init__.py", line 4, in <module> from .models import * File "/usr/local/lib/python3.9/dist-packages/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 "/usr/local/lib/python3.9/dist-packages/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 "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/local/lib/python3.9/dist-packages/gfpgan/models/gfpgan_model.py", line 6, in <module> from basicsr.losses.gan_loss import r1_penalty ModuleNotFoundError: No module named 'basicsr.losses.gan_loss' ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 3906) of binary: /usr/bin/python3 Traceback (most recent call last): File "/usr/local/bin/torchrun", line 33, in <module> sys.exit(load_entry_point('torch', 'console_scripts', 'torchrun')()) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 794, in main run(args) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/run.py", line 785, in run elastic_launch( File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 134, in __call__ return launch_agent(self._config, self._entrypoint, list(args)) File "/usr/local/lib/python3.9/dist-packages/torch/distributed/launcher/api.py", line 250, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ tests/test_gfpgan_model.py FAILED ------------------------------------------------------------ Failures: <NO_OTHER_FAILURES> ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2023-04-04_15:38:24 host : ebde7a4ebafa rank : 0 (local_rank: 0) exitcode : 1 (pid: 3906) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#332