Error opening FaceSwap

Installing and setting up FaceSwap


Forum rules

Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
Theunamedone
Posts: 2
Joined: Mon Sep 07, 2020 12:25 am

Error opening FaceSwap

Post by Theunamedone »

Guys I successfully installed FaceSwap on my windows 10 with radeon card however when clicking on open the app it opens a ready cmd jenela and then closes and the program does not open.
Could someone please help me?

faceswap_gui.log

Code: Select all

09/06/2020 21:28:22 MainProcess     MainThread      logger          log_setup                 INFO     Log level set to: INFO
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR    There was an error importing Tensorflow. This is most likely because you do not have TensorFlow installed, or you are trying to run tensorflow-gpu on a system without an Nvidia graphics card. Original import error: Traceback (most recent call last):
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR      File "C:\Users\Kleber\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR        from tensorflow.python.pywrap_tensorflow_internal import *
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR      File "C:\Users\Kleber\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR        _pywrap_tensorflow_internal = swig_import_helper()
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR      File "C:\Users\Kleber\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR      File "C:\Users\Kleber\MiniConda3\envs\faceswap\lib\imp.py", line 242, in load_module
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR        return load_dynamic(name, filename, file)
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR      File "C:\Users\Kleber\MiniConda3\envs\faceswap\lib\imp.py", line 342, in load_dynamic
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR        return _load(spec)
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR    ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou.
09/06/2020 21:28:23 MainProcess     MainThread      launcher        execute_script            ERROR    
09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR
09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR Failed to load the native TensorFlow runtime. 09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR
09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR See https://www.tensorflow.org/install/errors 09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR
09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR for some common reasons and solutions. Include the entire stack trace 09/06/2020 21:28:23 MainProcess MainThread launcher execute_script ERROR above this error message when asking for help.
by torzdf » Thu Sep 10, 2020 9:57 pm

Solved literally 2 posts down:

viewtopic.php?f=4&t=932

Go to full post
User avatar
bryanlyon
Site Admin
Posts: 793
Joined: Fri Jul 12, 2019 12:49 am
Answers: 44
Location: San Francisco
Has thanked: 4 times
Been thanked: 218 times
Contact:

Re: Error opening FaceSwap

Post by bryanlyon »

The first suggestion is always app.php/faqpage#f1r1 . This will usually solve installation problems.

User avatar
Theunamedone
Posts: 2
Joined: Mon Sep 07, 2020 12:25 am

Re: Error opening FaceSwap

Post by Theunamedone »

Thanks friend for the answer, but the topic didn't help me!

:? :? :? :?

User avatar
bryanlyon
Site Admin
Posts: 793
Joined: Fri Jul 12, 2019 12:49 am
Answers: 44
Location: San Francisco
Has thanked: 4 times
Been thanked: 218 times
Contact:

Re: Error opening FaceSwap

Post by bryanlyon »

After that, since this problem is in Tensorflow I suggest reading the link included there https://www.tensorflow.org/install/errors In particular the ones labelled as "ModuleNotFoundError: No module named 'tensorflow.python._pywrap_tensorflow_internal'" and "ImportError: DLL load failed: The specified module could not be found."

User avatar
kellurian
Posts: 9
Joined: Fri Jul 12, 2019 5:15 am
Has thanked: 3 times
Been thanked: 1 time

Re: Error opening FaceSwap

Post by kellurian »

Bryan,
I am also having this exact same issue. It was working fine, then I did the update option in the gui, which I think updated the tensorflow to 2.2 and since then it won't load and I get the exact same error message. I also did all the recommended removals. I couldn't find an answer on the tensorflow board...

User avatar
kellurian
Posts: 9
Joined: Fri Jul 12, 2019 5:15 am
Has thanked: 3 times
Been thanked: 1 time

Re: Error opening FaceSwap

Post by kellurian »

Ok, I think I found the answer at the tensorflow board. It has to do with visual c++ for visual studio. I think the latest iteration of tensorflow, 2.1 or higher, requires these specific updates to work correctly. You can download it here: https://support.microsoft.com/en-us/hel ... -downloads

Its under "Visual Studio 2015, 2017 and 2019" and download the x64 link. Reboot and it should work, or at least did for me.

User avatar
Anand
Posts: 1
Joined: Thu Sep 10, 2020 3:00 pm

Re: Error opening FaceSwap

Post by Anand »

kellurian wrote: Thu Sep 10, 2020 3:58 am

Ok, I think I found the answer at the tensorflow board. It has to do with visual c++ for visual studio. .....

THANK YOU. Your solution totally worked for me. I registered and logged in specifically to thank you. :-)

User avatar
torzdf
Posts: 2651
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 129 times
Been thanked: 622 times

Re: Error opening FaceSwap

Post by torzdf »

Solved literally 2 posts down:

viewtopic.php?f=4&t=932

My word is final

User avatar
Joons9000
Posts: 1
Joined: Sat Sep 25, 2021 6:55 pm

Failed to load the native TensorFlow runtime. (Tried many things already)

Post by Joons9000 »

Error:
I have keep on getting errors regarding the TensorFlow importation upon clicking the desktop icon for it.
What I have done:
I have uninstalled and reinstalled visual studio 2013 2015 2017 2019.
I have tried installing an older version of TensorFlow to no avail.
I installed anaconda and installed tensorflow through there.
I tried to install tensorflow-directml, also didnt work.
Restarted computer, didnt work.
System Info:
Using Windows 10 64bit, Python 3.9 and also I installed the tensorflow through anaconda. (AMD GPU)

Error Itself:

Code: Select all

C:\Users\David\faceswap>"C:\Users\David\Miniconda3\scripts\activate.bat"   && conda activate "faceswap"   && python "C:\Users\David\faceswap/faceswap.py" gui
Setting Faceswap backend to AMD
09/25/2021 11:52:00 INFO     Log level set to: INFO
09/25/2021 11:52:07 ERROR    A DLL library file failed to load. Make sure that you have Microsoft Visual C++ Redistributable (2015, 2017, 2019) installed for your machine from: https://support.microsoft.com/en-gb/help/2977003. Original error: Traceback (most recent call last):
  File "C:\Users\David\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\David\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\David\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\David\MiniConda3\envs\faceswap\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\David\MiniConda3\envs\faceswap\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
09/25/2021 11:52:07 INFO Press "ENTER" to dismiss the message and close FaceSwap

User avatar
torzdf
Posts: 2651
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 129 times
Been thanked: 622 times

Re: Error opening FaceSwap

Post by torzdf »

There are many reasons this can occur. Check this thread first.

The candidate most likely in this case though, is that your CPU does not support AVX instructions.

There are ways around this. You can see here for a recent discussion around a similar issue in our Discord:
https://discord.com/channels/4419893984 ... 6721560576

My word is final

Locked