[Guide] macOS Install Guide: Installer Method

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.

User avatar
lev12354
Posts: 7
Joined: Thu Aug 31, 2023 1:16 pm
Has thanked: 3 times
Been thanked: 1 time

Re: [Guide] macOS Install Guide: Installer Method

Post by lev12354 »

torzdf wrote: Fri Sep 01, 2023 10:59 am

GPU is used for training/extract/convert etc.

If you run with loglevel VERBOSE then you should get an output from Tensorflow saying which device it is using

Good afternoon, I managed to get the GPU to work as well. I installed miniconda3 for x86-64 platform, but the config to install faceswap I used Apple Silicon. And now the video card is involved in the processing.

User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

So you selected "APPLE-SILICON" using the install script and it just worked?

If so, I will update the instructions to reflect this for other x64/AMD users

My word is final

User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

hullo wrote: Sat Sep 02, 2023 7:15 am

And now the hard part. Tiny black font against dark gray background. :shock:

There is some control over font size etc in Settings > GUI settings.

If you can't read the items here, then you can also edit this in the file ~/faceswap/config/gui.ini

My word is final

User avatar
adriadg
Posts: 8
Joined: Sat Sep 02, 2023 10:32 am
Has thanked: 3 times

Re: [Guide] macOS Install Guide: Installer Method

Post by adriadg »

Hi!

I am trying to install in my Macbook Pro M1pro, but something goes wrong because there is no app file in the desktop.

I tried to install again, attached find the terminal log, anyone could help me to find the problem to fix it?

Thnks in advance!

Code: Select all

Last login: Sat Sep  2 12:15:55 on ttys000
adrideugelabert@MacBook-Pro-de-Adri ~ % conda activate faceswap
cd faceswap
python faceswap.py gui
cd: no such file or directory: faceswap
python: can't open file '/Users/adria/faceswap.py': [Errno 2] No such file or directory
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % conda activate faceswap
cd faceswap
python faceswap.py gui ./miniconda3
cd: no such file or directory: faceswap
python: can't open file '/Users/adria/faceswap.py': [Errno 2] No such file or directory
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % ./miniconda 
zsh: no such file or directory: ./miniconda
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % faceswap_setup_macos.sh
zsh: command not found: faceswap_setup_macos.sh
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % bash ./downloads/faceswap_setup_macos.sh
                         001
                        11 10  010
               @@@@      10
            @@@@@@@@         00     1
          @@@@@@@@@@  1  1            0
        @@@@@@@@    0000 01111
       @@@@@@@@@@    01  110 01  1
      @@@@@@@@@@@@ 111    010    0
      @@@@@@@@@@@@@@@@  10    0
      @@@@@@@@@@@@@   0010   1
      @@@@@@@@@  @@@   100         1
      @@@@@@@ .@@@@  10       1
       #@@@@@@@@@@@  001       0
         @@@@@@@@@@@  ,
         @@@@@@@@  @@@@@
        @@@@@@@@ @@@@@@@@    _
       @@@@@@@@@,@@@@@@@@  / _|
       %@@@@@@@@@@@@@@@@@ | |_  ___ 
           @@@@@@@@@@@@@@ |  _|/ __|
            @@@@@@@@@@@@  | |  \__ \
             @@@@@@@@@@(  |_|  |___/
                @@@@@@
                 @@@@

================ Welcome to the macOS Faceswap Installer ================
INFO    To get setup we need to gather some information about where you would
INFO    like Faceswap and Conda to be installed.
INFO    To accept the default values just hit the 'ENTER' key for each option.
INFO    You will have an opportunity to review your responses prior to
INFO    commencing the install.

INFO    IMPORTANT: Make sure that the user 'adrideugelabert' has full
INFO    permissions for all of the destinations that you select.
Press 'ENTER' to continue with the setup...

================================= CONDA =================================
INFO    Faceswap uses Conda as it handles the installation of all
INFO    prerequisites.
INFO    Found existing conda install at: /Users/adria/miniconda3
Use the pre installed conda? [YES/no]: n

INFO    If you have an existing Conda install then enter the location here,
INFO    otherwise Miniconda3 will be installed in the given location.
Please specify a location for Conda. [default: '/Users/adria/miniconda3']: 

INFO    Faceswap will be installed inside a Conda Environment. If an
INFO    environment already exists with the name specified then it will be
INFO    deleted.
Please specify a name for the Faceswap Conda Environmnet [default: 'faceswap']: 

================================ FACESWAP ================================
INFO    Faceswap will be installed in the given location. If a folder exists
INFO    at the location you specify, then it will be deleted.
Please specify a location for Faceswap [default: '/Users/adria/faceswap']: 

INFO    Faceswap can be run on Apple Silicon (M1, M2 etc.), compatible NVIDIA
INFO    gpus, or on CPU. You should make sure that any drivers are up to
INFO    date. Please select the version of Faceswap you wish to install.
Select:	1: Apple Silicon
	2: NVIDIA
	3: CPU
Invalid selection.
Select:	1: Apple Silicon
	2: NVIDIA
	3: CPU


======================= POST INSTALLATION ACTIONS =======================
INFO    Launching Faceswap requires activating your Conda Environment and then
INFO    running Faceswap. The installer can simplify this by creating an
INFO    Application Launcher file and placing it on your desktop to launch
INFO    straight into the Faceswap GUI
Create FaceswapGUI Launcher? [YES/no]: y

========================= Review install options =========================
INFO    Please review the selected installation options before proceeding:

    - Existing Conda install at '/Users/adria/miniconda3' will be used
    - Existing Conda Environment faceswap  will be removed
    - Conda Environment 'faceswap' will be created.
    - Faceswap will be installed in '/Users/adria/faceswap'
    - Installing for 'apple_silicon'
    - An Application Launcher will be created
Do you wish to continue? [yes/NO]: y
INFO    Removing pre-existing Virtual Environment


CondaEnvironmentError: cannot remove current environment. deactivate and run conda remove again

INFO    Creating Conda Virtual Environment...

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /Users/adria/miniconda3/envs/faceswap

  added / updated specs:
    - python=3.10


The following NEW packages will be INSTALLED:

  bzip2              pkgs/main/osx-arm64::bzip2-1.0.8-h620ffc9_4 
  ca-certificates    pkgs/main/osx-arm64::ca-certificates-2023.05.30-hca03da5_0 
  libffi             pkgs/main/osx-arm64::libffi-3.4.4-hca03da5_0 
  ncurses            pkgs/main/osx-arm64::ncurses-6.4-h313beb8_0 
  openssl            pkgs/main/osx-arm64::openssl-3.0.10-h1a28f6b_2 
  pip                pkgs/main/osx-arm64::pip-23.2.1-py310hca03da5_0 
  python             pkgs/main/osx-arm64::python-3.10.12-hb885b13_0 
  readline           pkgs/main/osx-arm64::readline-8.2-h1a28f6b_0 
  setuptools         pkgs/main/osx-arm64::setuptools-68.0.0-py310hca03da5_0 
  sqlite             pkgs/main/osx-arm64::sqlite-3.41.2-h80987f9_0 
  tk                 pkgs/main/osx-arm64::tk-8.6.12-hb8d0fd4_0 
  tzdata             pkgs/main/noarch::tzdata-2023c-h04d1e81_0 
  wheel              pkgs/main/osx-arm64::wheel-0.38.4-py310hca03da5_0 
  xz                 pkgs/main/osx-arm64::xz-5.4.2-h80987f9_0 
  zlib               pkgs/main/osx-arm64::zlib-1.2.13-h5a0b063_0 


Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
INFO    Downloading Faceswap...

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
INFO    Setting up Faceswap...
python: can't open file '/Users/adria/faceswap/setup.py': [Errno 2] No such file or directory
./downloads/faceswap_setup_macos.sh: line 449: /Users/adria/faceswap/faceswap_gui_launcher.command: No such file or directory
chmod: /Users/adria/faceswap/faceswap_gui_launcher.command: No such file or directory
unzip:  cannot find or open /Users/adria/faceswap/.install/macos/app.zip, /Users/adria/faceswap/.install/macos/app.zip.zip or /Users/adria/faceswap/.install/macos/app.zip.ZIP.
./downloads/faceswap_setup_macos.sh: line 463: /var/folders/zw/wkql2zsn1r7g3vcvbr_hcwfr0000gn/T/tmp.G5mkokOm/FaceswapGUI.app/Contents/Resources/script: No such file or directory
chmod: /var/folders/zw/wkql2zsn1r7g3vcvbr_hcwfr0000gn/T/tmp.G5mkokOm/FaceswapGUI.app/Contents/Resources/script: No such file or directory
mv: rename /var/folders/zw/wkql2zsn1r7g3vcvbr_hcwfr0000gn/T/tmp.G5mkokOm/FaceswapGUI.app to /Users/adria/Desktop/FaceswapGUI.app: No such file or directory
INFO    Faceswap installation is complete!
INFO    You can launch Faceswap from the icon on your desktop
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % conda activate faceswap
cd faceswap
python faceswap.py gui
cd: no such file or directory: faceswap
python: can't open file '/Users/adria/faceswap.py': [Errno 2] No such file or directory
(faceswap) adrideugelabert@MacBook-Pro-de-Adri ~ % 

User avatar
lev12354
Posts: 7
Joined: Thu Aug 31, 2023 1:16 pm
Has thanked: 3 times
Been thanked: 1 time

Re: [Guide] macOS Install Guide: Installer Method

Post by lev12354 »

torzdf wrote: Sat Sep 02, 2023 10:26 am

So you selected "APPLE-SILICON" using the install script and it just worked?

If so, I will update the instructions to reflect this for other x64/AMD users

Yes, that's correct. But I don't understand if 30-50 iterations per 2 minutes is the norm when using Dlight with default functions?

But also in your script for macos I changed the conda installation type from Arm64 to x86-64. Otherwise the conda was not working correctly

Last edited by lev12354 on Sat Sep 02, 2023 10:45 am, edited 1 time in total.
User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

lev12354 wrote: Sat Sep 02, 2023 10:44 am

Yes, that's correct. But I don't understand if 30-50 iterations per 2 minutes is the norm when using Dlight with default functions?

Ok, that's great. Thanks for confirming.

I can't comment on the speed as I can't benchmark it. You are probably best off in opening a new topic in Training Discussion

lev12354 wrote: Sat Sep 02, 2023 10:44 am

But also in your script for macos I changed the conda installation type from Arm64 to x86-64. Otherwise the conda was not working correctly

Yes, that is an oversight on my part. I will see if there is a way to make this selectable in the installer

Last edited by torzdf on Sat Sep 02, 2023 10:49 am, edited 1 time in total.

My word is final

User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

adriadg wrote: Sat Sep 02, 2023 10:37 am

I am trying to install in my Macbook Pro M1pro, but something goes wrong because there is no app file in the desktop.

Code: Select all


xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

There is an issue with your XCode install. See here for further info: https://apple.stackexchange.com/questio ... -use-git-a

My word is final

User avatar
adriadg
Posts: 8
Joined: Sat Sep 02, 2023 10:32 am
Has thanked: 3 times

Re: [Guide] macOS Install Guide: Installer Method

Post by adriadg »

you are right, now it works!

Thanks

User avatar
hullo
Posts: 16
Joined: Wed Aug 23, 2023 8:30 am
Been thanked: 1 time

Re: [Guide] macOS Install Guide: Installer Method

Post by hullo »

torzdf wrote: Sat Sep 02, 2023 10:31 am

There is some control over font size etc in Settings > GUI settings.

If you can't read the items here, then you can also edit this in the file ~/faceswap/config/gui.ini

There doesn't seem to be a way to change font color but I stumbled on a quirk: opening the settings window or switching to another app with Faceswap in the background changes the font color to white which is much easier to read. (Dark gray background stays the same.)

User avatar
btrfgo
Posts: 1
Joined: Sun Nov 19, 2023 7:02 am

Re: [Guide] macOS Install Guide: Installer Method

Post by btrfgo »

Help. I can't install the program. Mac Os Sonoma System. I paste the code into the terminal and nothing happens. How to solve a problem?

User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

btrfgo wrote: Tue Nov 21, 2023 10:36 pm

Help. I can't install the program. Mac Os Sonoma System. I paste the code into the terminal and nothing happens. How to solve a problem?

Try downloading the file: https://github.com/deepfakes/faceswap/r ... p_macos.sh

Then open up Terminal in your Downloads folder and execute:

Code: Select all

bash ./faceswap_setup_macos.sh
Last edited by torzdf on Wed Nov 22, 2023 12:52 pm, edited 1 time in total.

My word is final

User avatar
donutdonut
Posts: 1
Joined: Sun Dec 03, 2023 12:40 am

Re: [Guide] macOS Install Guide: Installer Method

Post by donutdonut »

hullo wrote: Sat Sep 02, 2023 7:15 am
torzdf wrote: Sun Aug 27, 2023 1:09 pm

Ok, this is all a bit mystifying, other macOS users have not reported this issue.

If it is not generating the log file, then there are definitely issues!

From the attached output, it appears to not find a location for where miniconda is installed, it then also fails to run some command.

Most likely you have some kind of issues/conflicts on your system. In the first instance you could try following the macOS equivalent of this:
app.php/faqpage#f1r1

Otherwise, the best I can offer, at this stage, is to follow the manual install steps:
https://github.com/deepfakes/faceswap/b ... tall-guide

Success! Thanks for your patience and guidance.

And now the hard part. Tiny black font against dark gray background. :shock:

nice! but what did you do? im also stuck at that 'numpy' issue

EDIT: i (also?) did the manual install and it worked

Last edited by donutdonut on Sun Dec 03, 2023 1:12 am, edited 1 time in total.
User avatar
araw
Posts: 1
Joined: Fri Mar 22, 2024 12:13 am

Re: [Guide] macOS Install Guide: Installer Method

Post by araw »

Hi, im running a M1 max mbp. Getting the following error:

Code: Select all

/Users/aa/faceswap/faceswap_gui_launcher.command ; exit;               
aa@MacBook-Pro-van-A ~ % /Users/aa/faceswap/faceswap_gui_launcher.command ; exit;
Setting Faceswap backend to APPLE_SILICON
Traceback (most recent call last):
  File "/Users/aa/faceswap/faceswap.py", line 12, in <module>
    from lib.cli import args as cli_args  # pylint:disable=wrong-import-position
  File "/Users/aa/faceswap/lib/cli/args.py", line 23, in <module>
    _GPUS = GPUStats().cli_devices
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 40, in __init__
    super().__init__(log=log)
  File "/Users/aa/faceswap/lib/gpu_stats/_base.py", line 95, in __init__
    self._initialize()
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 52, in _initialize
    self._initialize_metal()
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 77, in _initialize_metal
    self._test_tensorflow()
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 90, in _test_tensorflow
    meminfo = tf.config.experimental.get_memory_info('GPU:0')
  File "/Users/aa/miniconda3/envs/faceswap/lib/python3.10/site-packages/tensorflow/python/framework/config.py", line 576, in get_memory_info
    return context.context().get_memory_info(device)
  File "/Users/aa/miniconda3/envs/faceswap/lib/python3.10/site-packages/tensorflow/python/eager/context.py", line 1630, in get_memory_info
    return pywrap_tfe.TFE_GetMemoryInfo(self._context_handle, dev)
ValueError: No matching devices found for 'GPU:0'

Someone can help me out?
Thanks

Last edited by torzdf on Fri Mar 22, 2024 12:42 am, edited 1 time in total.
User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

Unfortunately there is not enough information in that error message to know what the issue is.

Most likely you are missing one of the pre-requisites

My word is final

User avatar
yazzgp3
Posts: 1
Joined: Tue Apr 09, 2024 7:21 pm

Re: [Guide] macOS Install Guide: Installer Method

Post by yazzgp3 »

araw wrote: Fri Mar 22, 2024 12:16 am

Hi, im running a M1 max mbp. Getting the following error:

Code: Select all

/Users/aa/faceswap/faceswap_gui_launcher.command ; exit;               
aa@MacBook-Pro-van-A ~ % /Users/aa/faceswap/faceswap_gui_launcher.command ; exit;
Setting Faceswap backend to APPLE_SILICON
Traceback (most recent call last):
  File "/Users/aa/faceswap/faceswap.py", line 12, in <module>
    from lib.cli import args as cli_args  # pylint:disable=wrong-import-position
  File "/Users/aa/faceswap/lib/cli/args.py", line 23, in <module>
    _GPUS = GPUStats().cli_devices
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 40, in __init__
    super().__init__(log=log)
  File "/Users/aa/faceswap/lib/gpu_stats/_base.py", line 95, in __init__
    self._initialize()
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 52, in _initialize
    self._initialize_metal()
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 77, in _initialize_metal
    self._test_tensorflow()
  File "/Users/aa/faceswap/lib/gpu_stats/apple_silicon.py", line 90, in _test_tensorflow
    meminfo = tf.config.experimental.get_memory_info('GPU:0')
  File "/Users/aa/miniconda3/envs/faceswap/lib/python3.10/site-packages/tensorflow/python/framework/config.py", line 576, in get_memory_info
    return context.context().get_memory_info(device)
  File "/Users/aa/miniconda3/envs/faceswap/lib/python3.10/site-packages/tensorflow/python/eager/context.py", line 1630, in get_memory_info
    return pywrap_tfe.TFE_GetMemoryInfo(self._context_handle, dev)
ValueError: No matching devices found for 'GPU:0'

Someone can help me out?
Thanks

I'm running into the exact same issue. Did anyone already figure out what causes this problem?

User avatar
torzdf
Posts: 2667
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

As stated above... there is not enough information in that error message.

See if you can do the cli version of this:
app.php/rules#rule-4a

My word is final

Post Reply