Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaceSwapLab - **ERROR** - Failed to swap face in postprocess method #18

Closed
Barzing0 opened this issue Aug 3, 2023 · 5 comments
Closed

Comments

@Barzing0
Copy link

Barzing0 commented Aug 3, 2023

2023-08-03 12:43:08,484 - FaceSwapLab - INFO - Try to use model : D:\A1111\stable-diffusion-webui\models\faceswaplab\inswapper_128.onnx█████| 20/20 [00:02<00:00, 9.21it/s]
2023-08-03 12:43:09,410 - FaceSwapLab - INFO - blend all faces together
2023-08-03 12:43:09,413 - FaceSwapLab - INFO - Load analysis model, will take some time.
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
2023-08-03 12:43:10,291 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00, 4.49it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00, 9.21it/s]

To Reproduce
nothing special, just start A1111 with
--medvram --xformers --administrator --api --no-half-vae --theme dark
Once UI loadeded, i prompt "portrait of a woman", i generate with a face to swap (no parameter modified)
i also tried without --medvram i had same result
While roop 0.0.2 (also installed) works each time

Desktop (please complete the following information):

  • OS: Windows 10 with 32gb RAM and Nvidia Geforce RTX 3070 Ti
  • Browser : Edge & Opera GX (tried with both)
@glucauze
Copy link
Owner

glucauze commented Aug 3, 2023

It's very strange because my loading method isn't very different. I'm not sure what could be causing this.

Maybe a corrupted inswapper file?

Or maybe it's a problem of installed dependencies. Could you look at the onnx and onnxruntime versions installed with pip list?

This is done by activating the stable diffusion environment:
venv/Scripts/activate.bat (or activate.ps1) under Windows

Did you install onnxruntime-gpu ?

@Barzing0
Copy link
Author

Barzing0 commented Aug 3, 2023

onnx 1.14.0
onnxruntime-gpu 1.12.1
onnxruntime 1.15.0

(venv) D:\A1111\stable-diffusion-webui\venv\Lib\site-packages>pip install onnxruntime-gpu
WARNING: Ignoring invalid distribution -rotobuf (d:\a1111\stable-diffusion-webui\venv\lib\site-packages)
Requirement already satisfied: onnxruntime-gpu in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (1.12.1)
Requirement already satisfied: coloredlogs in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (15.0.1)
Requirement already satisfied: flatbuffers in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (2.0.7)
Requirement already satisfied: numpy>=1.21.0 in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (1.23.5)
Requirement already satisfied: packaging in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (23.1)
Requirement already satisfied: protobuf in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (3.20.3)
Requirement already satisfied: sympy in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (1.11.1)
Requirement already satisfied: humanfriendly>=9.1 in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from coloredlogs->onnxruntime-gpu) (10.0)
Requirement already satisfied: mpmath>=0.19 in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from sympy->onnxruntime-gpu) (1.3.0)
Requirement already satisfied: pyreadline3 in d:\a1111\stable-diffusion-webui\venv\lib\site-packages (from humanfriendly>=9.1->coloredlogs->onnxruntime-gpu) (3.4.1)
WARNING: Ignoring invalid distribution -rotobuf (d:\a1111\stable-diffusion-webui\venv\lib\site-packages)
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

(venv) D:\A1111\stable-diffusion-webui\venv\Lib\site-packages>

Is this warning could be the problem ?

@glucauze
Copy link
Owner

glucauze commented Aug 3, 2023

Ok I think the problem comes from the fact that onnxruntime-gpu 1.12.1 is installed in your environment. I'm not managing the GPU at the moment.

I'll try to uninstall it to see (unless you need it):

pip uninstall onnxruntime-gpu

@Barzing0
Copy link
Author

Barzing0 commented Aug 3, 2023

ok i uninstalled onxruntime-gpu and i had to uninstall onxruntime too.
onxruntime-gpu was coming from another extension i installed and unisntalled sometime (probably deepfaceLab), cause i never installed this manually.
Now it works !

@glucauze
Copy link
Owner

glucauze commented Aug 3, 2023

I'll have to find a solution to manage the GPU too later on. Otherwise, certain frameworks could cause problems. I'll close it for now.

@glucauze glucauze closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants