wl-zhao / DiffSwap

[CVPR 2023] DiffSwap is a diffusion-based face-swapping framework.
99 stars 10 forks source link

TypeError: get_input() got an unexpected keyword argument 'swap' #16

Open Ta01017 opened 8 months ago

Ta01017 commented 8 months ago

I don't know if it's because of the python version issue The error message that I am receiving is as follows:

[21:36:07.657087] [21:36:07.657054] [21:36:07.657129] model built
[21:36:07.657703] [21:36:07.657692] [21:36:07.657716] len(self.src_list): 1
[21:36:07.658159] [21:36:07.658149] [21:36:07.658173] start batch
0%|                                                                                                               | 0/1 [00:00<?, ?it/s][21:36:08.125726] [21:36:08.125633] [21:36:08.125804] perform_swap
0%|                                                                                                               | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "tests/faceswap_portrait.py", line 212, in <module>
perform_swap(model.module, batch, ckpt, ddim_sampler)
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "tests/faceswap_portrait.py", line 115, in perform_swap
z, c, x, xrec, xc = self.get_input(batch, self.first_stage_key,
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
TypeError: get_input() got an unexpected keyword argument 'swap'
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 284114) of binary: /home/liwt/.conda/envs/diffswap/bin/python3
Traceback (most recent call last):
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/distributed/launch.py", line 193, in <module>
main()
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/distributed/launch.py", line 189, in main
launch(args)
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/distributed/launch.py", line 174, in launch
run(args)
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/distributed/run.py", line 715, in run
elastic_launch(
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 131, in __call__
return launch_agent(self._config, self._entrypoint, list(args))
File "/home/liwt/.conda/envs/diffswap/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 245, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
============================================================
tests/faceswap_portrait.py FAILED
------------------------------------------------------------
Failures:
<NO_OTHER_FAILURES>
------------------------------------------------------------
LiGe-In commented 8 months ago

I encountered the same problem. @wl-zhao Could you share the torch version?

LiBiying commented 3 months ago

I also met this problem. It's caused by the wrong import path of LatentDiffusion. I solved it by checking "sys.path" and deleting the path of stable-diffusion in the list.