Working on Faceswap for M1 Mac

Talk about Hardware used for Deep Learning
Post Reply
User avatar
geewiz94
Posts: 5
Joined: Wed Nov 24, 2021 8:17 pm

Working on Faceswap for M1 Mac

Post by geewiz94 »

Edit: M1 support has now been added to FS!
Many thanks to daniellivingston and @torzdf for updating to Tensorflow 2.8 and merging!

This means there is now GPU support on M1 Macs. According to my tests, all the models seem to be working! If there are any issues, feel free to respond to this topic.

You can install by following these instructions:
https://github.com/deepfakes/faceswap/b ... tall-guide

previous post:
---

Hi,
after getting myself a M1 MacBook Pro, I was curious to see if I could make Faceswap work on it. After several days of trial and error, I was able to set up a testing environment using:
- Python 3.8
- Tensorflow 2.7
I followed the instructions from Apple, modified the instructions a bit and documented my working setup here:
https://github.com/geewiz94/faceswap/bl ... tall-guide

What I learned:
- Anaconda is not supported, but we can use Miniforge instead.
- tensorflow-macos 2.5/2.6 don't seem to like Python 3.8, installation fails.
- tensorflow-macos 2.5/2.6 installation works using Python 3.9, but we can't use that to run Faceswap.
- So Faceswap either needs to be modified to support Tensorflow 2.7 or Python 3.9?
- fastcluster doesn't install on amd64, skipped that, so Extract is not working for now.

Result:
- GUI starts
- CPU training works, using all M1 cores.

Next I want to try and get GPU training working. I think I need to find a way to get GPU stats from the M1 chip. I have some basic Python experience, but if any developer reads this, perhaps you can point me in the right direction :D

I would also be happy to help out by doing some testing.

Last edited by geewiz94 on Fri May 13, 2022 8:30 am, edited 1 time in total.

User avatar
geewiz94
Posts: 5
Joined: Wed Nov 24, 2021 8:17 pm

Re: Working on Faceswap for M1 Mac

Post by geewiz94 »

Made some progress:
I managed to modify GPUStats enough to start training in GPU mode. Now I'm getting:

Code: Select all

cannot import name 'get_custom_objects' from 'keras.utils'

Code: Select all

12/05/2021 14:44:41 MainProcess     MainThread                     logger          log_setup                      INFO     Log level set to: INFO
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    Initializing GPUStats
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    Apple Silicon Detected.
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    GPU Device count: 1
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    Active GPU Devices: [0]
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    GPU Handles found: 1
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    GPU Driver: 1.0
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    GPU Devices: ['Apple M1']
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    GPU VRAM: [16384]
12/05/2021 14:44:41 MainProcess     MainThread                     gpu_stats       _log                           DEBUG    Initialized GPUStats
12/05/2021 14:44:41 MainProcess     MainThread                     launcher        _configure_backend             DEBUG    Executing: train. PID: 65286
12/05/2021 14:44:41 MainProcess     MainThread                     launcher        _test_for_tf_version           DEBUG    Installed Tensorflow Version: 2.7
12/05/2021 14:44:42 MainProcess     MainThread                     queue_manager   __init__                       DEBUG    Initializing QueueManager
12/05/2021 14:44:42 MainProcess     MainThread                     queue_manager   __init__                       DEBUG    Initialized QueueManager
12/05/2021 14:44:42 MainProcess     MainThread                     train           __init__                       DEBUG    Initializing Train: (args: Namespace(batch_size=64, colab=False, configfile=None, distributed=False, exclude_gpus=None, freeze_weights=False, func=<bound method ScriptExecutor.execute_script of <lib.cli.launcher.ScriptExecutor object at 0x16bb6c0a0>>, input_a='/Users/server/Documents/_TRAINING_SETS/A/aligned', input_b='/Users/server/Documents/_TRAINING_SETS/B/aligned', iterations=1000000, load_weights=None, logfile=None, loglevel='INFO', model_dir='/Users/server/Documents/model', no_augment_color=False, no_flip=False, no_logs=False, no_warp=False, preview=False, preview_scale=100, redirect_gui=True, save_interval=250, snapshot_interval=25000, summary=False, timelapse_input_a=None, timelapse_input_b=None, timelapse_output=None, trainer='dfl-sae', warp_to_landmarks=True, write_image=False)
12/05/2021 14:44:42 MainProcess     MainThread                     train           _get_images                    DEBUG    Getting image paths
12/05/2021 14:44:42 MainProcess     MainThread                     utils           get_image_paths                DEBUG    Scanned Folder contains 770 files
12/05/2021 14:44:42 MainProcess     MainThread                     utils           get_image_paths                DEBUG    Returning 770 images
12/05/2021 14:44:42 MainProcess     MainThread                     train           _get_images                    DEBUG    Test file: (filename: /Users/server/Documents/_TRAINING_SETS/A/aligned/00001_0.png, metadata: {'width': 256, 'height': 256, 'itxt': {'alignments': {'x': 864, 'w': 213, 'y': -9, 'h': 294, 'landmarks_xy': [[878.9874877929688, 95.12928009033203], [870.755615234375, 126.70247650146484], [869.4014282226562, 152.7521514892578], [870.755615234375, 178.8125], [874.87158203125, 208.9781036376953], [883.1033325195312, 232.3194580078125], [891.335205078125, 250.13731384277344], [899.5670776367188, 266.6009826660156], [924.2625122070312, 285.8157043457031], [959.9088745117188, 285.8157043457031], [991.471435546875, 276.229736328125], [1016.1775512695312, 266.6009826660156], [1042.227294921875, 250.13731384277344], [1058.6910400390625, 226.83868408203125], [1071.0386962890625, 204.8621826171875], [1086.10546875, 177.4476776123047], [1097.0562744140625, 148.63621520996094], [888.5841674804688, 60.84776306152344], [895.451171875, 53.9700927734375], [910.5178833007812, 55.36699295043945], [920.1466674804688, 62.20193099975586], [931.0974731445312, 71.8306655883789], [984.6044311523438, 86.8974380493164], [1001.068115234375, 86.8974380493164], [1020.2828979492188, 91.01336669921875], [1039.465576171875, 99.24520111083984], [1055.92919921875, 114.3547134399414], [947.5612182617188, 117.10577392578125], [937.9645385742188, 140.40438842773438], [928.3784790039062, 156.86805725097656], [924.2625122070312, 173.3317413330078], [916.03076171875, 177.4476776123047], [920.1466674804688, 182.9284210205078], [928.3784790039062, 189.79541015625], [940.7262573242188, 189.79541015625], [950.312255859375, 189.79541015625], [899.5670776367188, 92.41027069091797], [905.0478515625, 89.6592025756836], [918.749755859375, 93.77511596679688], [931.0974731445312, 106.12286376953125], [916.03076171875, 106.12286376953125], [905.037109375, 100.64209747314453], [984.6044311523438, 123.94071197509766], [996.9521484375, 119.8248062133789], [1012.051025390625, 123.94071197509766], [1025.7635498046875, 134.93431091308594], [1009.2999877929688, 136.28848266601562], [992.8362426757812, 132.17254638671875], [899.5670776367188, 207.6132354736328], [903.6829223632812, 206.2590789794922], [916.03076171875, 206.2590789794922], [924.2625122070312, 210.375], [932.494384765625, 210.375], [950.312255859375, 222.72276306152344], [968.1408081054688, 232.3087615966797], [948.9580688476562, 237.78955078125], [932.494384765625, 239.1864471435547], [920.1466674804688, 236.4246826171875], [909.153076171875, 232.3087615966797], [903.6829223632812, 222.72276306152344], [900.9212036132812, 210.375], [916.03076171875, 215.8450927734375], [924.2625122070312, 218.6068572998047], [935.21337890625, 222.72276306152344], [965.4216918945312, 230.95458984375], [933.8485717773438, 224.07691955566406], [924.2625122070312, 222.72276306152344], [914.6337890625, 218.6068572998047]], 'mask': {'components': {'mask': b'x\x9c\xed\x9a\x81\r\xc20\x0c\x04\xb3YF\xf3h\x19\xad\x80\x10"-\x12r\xff?\xb5\x04\x7f\x0b\xdc\xc7NK\x13\xd3\x9a1\xc6\x18c\x8c1\xc6\x18c\x8c1\xc6\x98\xff\xa5GlOFL\xf4\x8b\xec[\x86w,\xb5\x7f\xa4\xfc\x874:}n\xf9\xeb\x12\x04\xe6\x97%\x80\xfd\xa2\x04\x84_\x92\x80\xf2\xdf\x9fX\xf6)%\xfdt\x02\xda\xbfqmP\xf8\xef\t\xe0"h\xfcx\x1bT~4\x81\xce\x8fm\x03\xfb\xed\x17\x81\xe8\xed\xb7\xffG\xfc\xa3\xd8\x8f}\x05\xe8\xfc\xd8\x0f\xb0\xce\x0f\xe9[S\xe9\xb1\xf6\xeb\xfc\xe8G`\x88\xfc\xe8\x17\xa0\xca\x0f\xeaU\r@\xdb\xaf\xf2\xe3g\x80\x90\xf8\xf1S\x90\xc6\x0f\xeb5\r\xc0\xdb\x8f\xdd\xc0\x1c\xa9>\x02R\x87`\x81\x9f\xd1\x0b\n\xc0\xb4\x1f\xbe\x03\x9b /bh?\xa7\xa7\x1b\xc0\x95\x9fo\x00}\x0f68?\xab\'\x0b\xc0\x96\x9f-@\xf55$\xaf\xa7\x1eAA\xf9\xa9\x02h\x06%\xb0\xbe\xf8"^R\xfd\x07\xc5z\xf0\x1d \x9c\x92E\xad\x1ey\tig\x84\xfd\xac^\xd7|(\x80Z\x7f\xb2\x03+\x06\xb4\xf9\x00\xf4\xe4\x89\x0b \x9f\x03\x9f\x0b\xb0p8\x9e\x08\xa0\xdfx\x13\xbdr\xf1\x89\x00\xcb:\x9f\n\xb0h\xdbg\x03\xac_\xfc\xb7\x00K\xf7\xdd\x9e(*\xfd\x94`\xec\n\x7fQ\xe5g\xfa\xab\x08W\xfd\x17\xe7\x93\xd8F\xc1\xc2\x8d1\xc6p\xdc\x00\xffVc\xad', 'affine_matrix': [[0.3200481648709836, 0.09329843938485899, -254.78927419234816], [-0.09329843938485897, 0.32004816487098364, 111.31994163088105]], 'interpolator': 2, 'stored_size': 128, 'stored_centering': 'face'}, 'extended': {'mask': b'x\x9c\xed\x9a\xdbm\xc30\x10\x04\xd5\x19K\xbb\xd2X\x1a\xf3\x11\x04\x90`\xc3\xa0v\x87"\x10\xef40\xc7[=\xf8:\x8e\x10B\x08!\x84\x10B\x08!\x84\x10\xbe\x9bV\xd5\xc7/\xbdN\xb4G\xec5\xa6\xb8TV\xc5\xf9\xe7\xf4/\xe5P\xcd\x99\x1c\xfe+P\x01]\xf5\x8f\x8e\xf8e=T\x80\xe1G2\xb0\xfc\xc3\x7f\x0f\xca+\xc0\xce\xc0\xf4\xdb\x19\xd8~3\x03\xdf\xefe\x00\xf8\xad\x0c\x1a\xe1w2@\xfcF\x06\x8c_\xcf\x80\xf2\xab\x19`~1\x03\xce\xafeP\xa0_\x89 \xfe\xef\xf67\xd0/\xe8\xd1\x170\xfe\xf8oS\x98^\xfb\x01q~\xed\x0f\xcc\xf9\xb5)\x08\xe7\x97\xf4\xdc\x03\xa8\xce\x01)\xbf:\t.\xc8\xaf\xce@)\xbf\xa8\xff/K\x00}\rT\x88__\x042~Y\xcf\x04\xe0\xac\xc2;\xe0w\xb6!\n\xf0[\xfb0\x80\xdf\xd1\x03\r\xf06\xc2\x9a\xed7w\x02m\xbf\xa7\xb7\x03p\xf7!\x9b\xe9\xb77b\xbb\xe7w\xf5f\x03\x80\xadx\xab\x01\xc0yP9~_\xbf\xff$\xc4h\x00s\x16%\xeb\xa1\xd3@\xb5\x01\xccA\xd8!\x1fERz\xf1\x1b\x00\x1e\x13\xd7^\xbd\xf2\x11b\x0f\xc9\xdb]=\x17\xbeT\x00\xad\xbf\x99\xc0\x8a\x1b\n\xf3\x05`w\x00\xb4\x02\xc0;\x10J\x01\x0bo\x87L\x14\xc0?x\'\xda\xce\xc1O\x14\xb0,\xf9\xa9\x02\x16=\xf6\xb3\x05\xac\x1f\xfc\xa7\x02\x96>wWjS\xebO\x15\xf4K\xe3\x1f\xea\xfc\x99\xf6\xd7\x84\x87.\xa3\xbd\xa1F\xdf0\xf0\x10B\x08\x1e?\xb8\xc5\x15\xd8', 'affine_matrix': [[0.3200481648709836, 0.09329843938485899, -254.78927419234816], [-0.09329843938485897, 0.32004816487098364, 111.31994163088105]], 'interpolator': 2, 'stored_size': 128, 'stored_centering': 'face'}, 'bisenet-fp_face': {'mask': b'x\x9c\xed\x9aa\x99\x84 \x10\x86m\xe05 \x82\x11\x88\xb0\x11\x88`\x04"l\x04"\x18\x81\x08F \x82\x11\xb8]\xcf}v\xef\xceue\xbeo\xf4\x0fo\x81W\x81\x19\x06\x98\xa6\xa9T*\x95J\xa5R\x91a\xac\x0f)\x9e%w)\xcf\xb8\xc3\xd5\xd6\xf9\xb8\xc8o\x1c<\x00\x9d\x9f\xf2o\x86\xf6 \xf5\x97\xf5C\xca\xff\x99.G\xd8mXQ/\xf4\xca\xee\xae\x0fk?\xfe\xe4\xaaiw\xdb\xee\x19\xa3%o\xfd\x0e{\xce\xa3\xd2"\xbc\xfc]\xed\xef\xf0*z\xb7\xd3~\x0b\x02\x05{\x1bw\xebUb\xe0Z\xa0\xcf\xd9\xb2\xf5\xdd\xde\xb9\xffa`\xfbS\x91\x9e\x1e\x83\xaePO\x1e\x00[\xaa\'g\xc1X\xee\xcf\xc4$$\xf8}j\x12\n\x12?/\x06\x8dH\x9fG\x96\xdf\xc9\xfc\xb4\x01(K}OX\xb5P\x14\xfas\xe2\xc4@\x92\xfaI\x95\x80X\xcf)\xc8;\xc0\xcf\xc8\x02\x16\xf1\x13\x8eD\x1e\xf2\xe3;!\xe8\x87wB\xd0\x0f/\x01\xd4?\x81A\x88\xfa\xd1\x01\x80\xfd\xe0\x00\xc0\xfe\x1cN\xf6c\x03\x80\xfb\xb1\x15@\xf0C\x03@\xf0C+\xa0\'\xf8\x91\x13\xa9%\xf8\x91m\x88\xe2\x07&\x80\xe2\x07V \xc5\x0fL\x00\xc7/\xdf\x869~\xf9y\xd0p\xfc\xf2\t\xe0\xf8\xe5\x87\x01\x8e_\x1e\x82$\xbf\xb8\x12e\xf9\xa5\x07b\x96_z \x8e,\x7fw\xae_\xba\t\xb2\xfc\xd2+1O\xf2K\xaf#\x18\x05\xc8\x1di\xfcA\x07\xf0\'I\xa8o\x9a\xb2\xbb\xe7w\xc8K\x90\x81\xe2\x97\xdfF9\x8a_^\x01\x19\x86\x1e\xb9\x07\x18\t~a\xf2\x9b!D\xa0|\xf57\x94\x08\xc4\x9e\xa4\x12\xec\xc7.\x83\x03\xec\x87\xf4\xcd\x05\xd5\x83w0-\xa8\x87V\xdf\x1d0\x05\xc2\xb7\xa0\xee\xdc\xdf\x07\'\x80\xf0\x12\x82L\x00\xe3\x16\x1eI\x81H\xea}`\xe4z\xceK`\x94\xea\xd1\xfb\xdf\x05q\nb=\x84&\x99\x9e\xf6\x0cie~^\'\x80(\x04\x89\xef\xf0m*\xd7S\xfb\x10l\xb1~\xe2\xf6a\x14\xbf\x04\x93\x1bq\xda\xc2B\x14{xX\xa1\xac\x10Th\x87\xf4\x05z\x95>\xb4x\xae~\x7f\x10&\xc6\xae\xb7\x82=\xf3\xef\xef\xec\xaa\x04\xa2b#l\xfc\xac\xa7\x07\xde+\xe6\xa3^\xb9\x07\xd6o\xdb\xf5{\x807\xd3\xe0\xa4\xb4\xf0_\xb0\x1b\xfaQ\xad\xfd\xf6\x85p\xae\xfe\xed\x07L\xda\xdd\xd7\x0f\xda\xd5\x0f\x08\xc7\xfc\xfcL\xff\xaf\xf7\xbe?\xaa\xf9~\xc1\xfa\xb8\x8cz\xf4\x8e\xdeq\xbb\x13c\xf5\xc3\xadR\xa9T*t\xbe\x01~^\xd1\x13', 'affine_matrix': [[0.3200481648709836, 0.09329843938485899, -254.78927419234816], [-0.09329843938485897, 0.32004816487098364, 111.31994163088105]], 'interpolator': 3, 'stored_size': 128, 'stored_centering': 'face'}}}, 'source': {'alignments_version': 2.2, 'original_filename': '00001_0.png', 'face_index': 0, 'source_filename': '00001.jpg', 'source_is_video': False, 'source_frame_dims': (1080, 1920)}}})
12/05/2021 14:44:42 MainProcess     MainThread                     train           _get_images                    INFO     Model A Directory: '/Users/server/Documents/_TRAINING_SETS/A/aligned' (770 images)
12/05/2021 14:44:42 MainProcess     MainThread                     utils           get_image_paths                DEBUG    Scanned Folder contains 398 files
12/05/2021 14:44:42 MainProcess     MainThread                     utils           get_image_paths                DEBUG    Returning 398 images
12/05/2021 14:44:42 MainProcess     MainThread                     train           _get_images                    DEBUG    Test file: (filename: /Users/server/Documents/_TRAINING_SETS/B/aligned/6797547230208265478_00001_0.png, metadata: {'width': 256, 'height': 256, 'itxt': {'alignments': {'x': 226, 'w': 192, 'y': 282, 'h': 280, 'landmarks_xy': [[223.76922607421875, 389.2649841308594], [221.2505340576172, 419.2222595214844], [224.9951934814453, 446.6607971191406], [228.73985290527344, 471.6474609375], [234.96849060058594, 500.3467102050781], [246.20245361328125, 522.814697265625], [261.1810607910156, 537.7932739257812], [279.9043884277344, 552.77197265625], [311.0876159667969, 565.2318725585938], [344.78955078125, 560.26123046875], [363.5128173828125, 549.0272827148438], [376.0074768066406, 537.7932739257812], [393.4700927734375, 516.5859985351562], [402.2200927734375, 489.1127014160156], [409.7093811035156, 466.644775390625], [417.19873046875, 440.4321594238281], [420.943359375, 412.9936218261719], [247.463134765625, 364.3130798339844], [261.1810607910156, 359.3103942871094], [277.42041015625, 356.82373046875], [291.1383361816406, 360.568359375], [303.6330261230469, 364.3130798339844], [358.542236328125, 371.8023986816406], [372.2628173828125, 368.0577087402344], [387.241455078125, 368.0577087402344], [402.2200927734375, 371.8023986816406], [412.193359375, 383.0363464355469], [327.326904296875, 401.7596435546875], [323.5822448730469, 420.48291015625], [323.5822448730469, 436.6875], [321.09564208984375, 451.6661376953125], [303.6330261230469, 462.900146484375], [309.86163330078125, 466.644775390625], [319.8376159667969, 470.3894958496094], [331.0715637207031, 466.644775390625], [338.5608825683594, 466.644775390625], [263.6677551269531, 390.525634765625], [274.9017028808594, 386.781005859375], [287.3936767578125, 389.2676696777344], [298.627685546875, 398.0149841308594], [287.3936767578125, 399.2409362792969], [273.6757507324219, 398.0149841308594], [353.53955078125, 402.985595703125], [368.5181579589844, 398.0149841308594], [382.236083984375, 399.2409362792969], [390.9861145019531, 405.5043029785156], [379.7521057128906, 409.2489318847656], [366.031494140625, 409.2489318847656], [281.1650390625, 500.3467102050781], [293.625, 492.857421875], [309.86163330078125, 489.1127014160156], [317.3509521484375, 489.1127014160156], [327.326904296875, 489.1127014160156], [342.3055419921875, 497.8280334472656], [353.53955078125, 507.8360290527344], [338.5608825683594, 519.0700073242188], [327.326904296875, 526.5592651367188], [313.6062927246094, 526.5592651367188], [301.1143493652344, 522.814697265625], [291.1383361816406, 515.3253784179688], [283.6490173339844, 500.3467102050781], [306.1169738769531, 500.3467102050781], [316.0929260253906, 500.3467102050781], [327.326904296875, 500.3467102050781], [349.7948913574219, 507.8360290527344], [327.326904296875, 510.3226623535156], [316.0929260253906, 511.5806579589844], [304.8589782714844, 507.8360290527344]], 'mask': {'components': {'mask': b'x\x9c\xed\x99\x01\x0e\x820\x10\x04\xf9Y\x9fvO\xeb\xd3P$F\x13\x13\xa17[.\xc6\x9d\x0f\xcc\xb1[\xc4\xb6\xcbb\x8c1\xc6\x18c\x8c1\xc6\x18c\x8c1\xe6\xdfiq\x9a\t\xee\xbe\x0e\xd1\xa5\xf6A\xb9v\x80\x8c]7@\xd2.\x1b k\xbf\xa3X\x86\xe9\xa7\xdf\xe0\xfa z\x1e@Cz\x1e\x00\xd4\xd3\x00:\xf5\xb3W \xa8~]\x1b\xd07\xaeG\x01\x08\xf4$\x80\x90\xf8\xf3\x01h\xfc\xf9W\xd0~\xfb9\xd5\xeb?\xff\x05\xb0\xff\xbf\xfd\x9a\xefO\xb5?\xaf\xd7\x14\xf0\xc3~E\x01\xe8\x0fh\xb5?~\xdfO\xf4\x8a\x02\x8a\xfdp\x0b\x1e\xd4\x0f\xf7_\xd8O\xb6?\x1b\xd4\x0f\xf5\xe5\xfe`z|\xfeP\xed\x87\x05\xd0\xe5GO \xb0\x9e\x15\xa08\x00$\xfe\xea\xf3?\x85?\x80_\xa0G\x05H\xfc\xf9\x004\xe7\xcf-\xed\x17\xdd\x82\xa4\xfd\xfc\xd7\xe7Ad\xfd\x1a}:\x00\xd9%T.\x00\xe1\x05T\xcf\xf8E\xedo\xb4\x84^z\x058\x1e\x80\xf4\xfa/\xb1\x04\xb5\xfa\xe1%(,\x7f\xa7\x0f\xe9\xc5\xe9o\xb4Z\xfd\xc8=\xe8\x14\xfdr\xbe\x03y\xf9O\xceu0M\x7f\xae\x83\x89\xfa\xe5\xb8\x83>W\x7f\xd4\xc1\xac\xa5\xf7\xce\x97\x08f?\xfcNTe\xff\x9a\xe0s\x84\x1e\x97\xd9?f\xb8\xdc\xfd6C\x99\xdb\x18c\x0c\xe1\x06\xf4\x8b\x0e\x01', 'affine_matrix': [[0.35073350169214235, 0.03703774015804282, -65.6308955358848], [-0.03703774015804283, 0.35073350169214235, -70.25819745185827]], 'interpolator': 2, 'stored_size': 128, 'stored_centering': 'face'}, 'extended': {'mask': b"x\x9c\xed\xda\x8b\x89\x031\x0c\x84aw\xa6\xd2T\x9aK\xdbc\t\xc7\x05B.k\xcd\xef\x88\x85\x99\x06>\xaf\xc6y\xd9\x19\xc3q\x1c\xc7q\x1c\xc7q\x1c\xc7q\x1c\xc7q\x9cw\x89|\x97\xa0\xa1y\xac\x05\\\xc0\xb2}fRz\x14pp\x01Y\xe4\x99\x05\xc4,\xf3\xc8\x16\x10tb\x01\xa9\xf9\xd9\xfb\xf8\xc7!\xf2\xd1\xec\xcff_\xe5\xc5\r\x90\xcd\xbe\xcck~\xe8\xbe\xb4\x01\xb2\xd9\x07x\xc5O\xc2\x176\xc0\xec\xf5\x83\xe0\x05?\x11\xbf\xbe\x01\xec\xdb\xbf\xbf_\xff\x0e\xcc\xf8\xdd\xaf\x7f\xfbw\xf5\x91\x8f\xffv\xbf\xce3\x05\xdc\xd8'\n\x90\xbe\x7fw\xfby\x7f_\xe1\x89\x02\x9a}\xf1\x04*U_<\x7f\x91}\xf5\xfcI\xf5E\xbe\xddO\x8d\x97\x8f\xdf\xba\xfd\xee\xe3O\xf17\xb8\xcck\x05\x10\xe7\xdf\x8a\xaf\xd7\xaf\x15@\xf8)\xf8\x00/\x15\x80\xf8\xf5\x010\xf7?Q\xf6\x89\xfa\x87P\x00t\x01\x98U\x9f\xe1\xcb\x03\x80\xc6_\x1d\x00v\xfdY|\x0f\x02\xaf\x7f\xa3\xc0c\xd3?\xb3>\x00p\xfag\x96}\x96_\xde\x82\xf0\x9f\x0fV\x1b\x80\xa7\x7f&z\xf9\x95\x8b\xf8-\xfc\xb8\xde\x01^\xfeo\xaeu\xb0\x8d\xbf\xd6\xc1F~|\xee`\xee\xe5?u\xb0k\xeb=\xe7\x9f\x11\xec~\xf8G\xb2k\xf6\x7f+x]\xc2\xa4\xff\xf0\xb5\xb0\x86\xaf\xdbOkh\xb3\x1d\xc7q\x1c%?\xf50\x9f\xc1", 'affine_matrix': [[0.35073350169214235, 0.03703774015804282, -65.6308955358848], [-0.03703774015804283, 0.35073350169214235, -70.25819745185827]], 'interpolator': 2, 'stored_size': 128, 'stored_centering': 'face'}, 'bisenet-fp_face': {'mask': b"x\x9c\xed\x9b\r\x95\xab0\x10FqP\tHX\tH@\x02\x12\x90\x80\x04$DB%\x8c\x04$ \x01\ty-\xdd\xb3\xfb\x1e-]2\xf7\x03\xce;\x9b\xcf\xc0\x85\xc9\xfc%\x99\x14EVVVVVV\xd6\x8f*[\x9b\xd5w\x1f'\xd0\xab\x10\xbfemy,\xfc\x1a\x97\x9a\xae\xed\xe5 z\x19\x9e\xe8\x8fO\xe8\x0fY\x88zz\x8d\x9f?\xc1v\xff\x86f\x9d\xfe\xd0\xd0V\xfb\xad\xc4e\xc5\xf6\x0b\x8d\xcdN\xfcg\xc7[\x91U{\xe0\xdb\xad\xf8\xbb\r\xf4\x9eP'\xe0o\xce(_\x841\x89\x1fc\xd0\xe2\x9bD|\x8c\xbd\x12_\xbe\t\xfc5)\xbd0\xa4\xe3\xe3\xa4\xfb\x80\x8b\x03\x7f\x93,\n\x1a\x1f\x7fP%\xc3\xc1\xc7\x8f\xa6\xc1WN\xbc\xca\x07\x83\x9b\xafY\x01s\xf3c\xa7\xe0{\x97\xff\xa6I\xc1\xf7\xe351H\xf8\x8a:@\xf8Q\xd0\x1e#\xbe\xa0\x0e!\xbe \x07!~<\x9b\x8f\x1d\xe0\x83\xf1q\x0e\xae\x18\x1f\xb7\x82)\x9d\xef\x0b\xe1\x14\xdc1\xfe\x95\xf2\x03\xe3\xe3\x004\xc6\xc7\x01\xe8\xe8}\xffQ\xcd\xf0%\xc4S\x07lN\xe6w\x94\x0f\x03\xc0(\x1f\x06\x00u\xbf8 <\xcc\xfew!>\xcc\xbe\x98\xdfs>\xaa\xc0\xc6\xf9\xa8\x02c\xf7\x83\x15\x98\xe3Q\x02\xaa\x04|\x92\x00\x14\xfc\xf1d>\t@\t\x1f\xec\xc2%|\x10\x80\xbf\x9d/(?,\x01*\xf8\xa4\x00\x08\xf2/*\x80\xc6\xf1\xa8\x01\t\x9c\x8f\x1a@A\xff\x81\x1a\xe0\x8a\xf3\xd9\x0e\x98\xf3\xd9\t\x80a>;\x84\xc5\r )\xbf\x85\xc0\x01\xe1\xfe\xa3\xa2|\xb8\xffs^\xbe|\x0b\xee\xbf\xc9\xf1\xf7,z\x07\x10\x18\x9em\xff\x8a\xf3\xcf\xbf`\x0b@\x97\x9ff@~\x03a\x88\x8f\xf1\xec\x04Fp\xfe\x8e\x1c@q\x036\x02\xbe\xe2\x02*\xf8\xf1\xb0\xf8<\xd4\xf8\xf9\x921\x04P\x024w\xf0\xc1\x8b\x97\x98\x1f\xd4`\xd5\x14\x889\xf9\xaa\x11\x08\xa7\x01\xf0\xdd\xc7\x97\xc6S\x7f\xdf\x19\x82\xb8\xf4\xff%\x8f\x01\x94SXi\x03`\xb3&\xe90\xa0\x9d\xfa\xfb\x8e\x10\x10M\xdf|\xa9K\xc3O\xf2\xc1\xdc\xb4F\x9c\xf7}K%\xf5!j\xeb\xdf\x95\xd2\x89\xef2\x04\x1a6\xe3%\x83GO\xbat\x1b\xf1\xb2\xd1\xb7\xa5\x9aM\xe7q\xbb\xe1\x8b\xa2\xdc0\x07\xbc#\xbex?\x05>\xeb\xba\xf38|io\xf1\xd2\xc9\xd7\xd7\xaa\xc7u\xdb\x1f\xf3$\xa2ym\x83\xf1\xb0\xa7\x08\xb7\x82\xd4/\xac0\xb4G?\x07\xa9;\xfb,\n\x16\x0e~\x08\x92\x95\x95\x95\x95\xf5\xdf\xeb\x0fP\x00\xc6\xa3", 'affine_matrix': [[0.35073350169214235, 0.03703774015804282, -65.6308955358848], [-0.03703774015804283, 0.35073350169214235, -70.25819745185827]], 'interpolator': 3, 'stored_size': 128, 'stored_centering': 'face'}}}, 'source': {'alignments_version': 2.2, 'original_filename': '6797547230208265478_00001_0.png', 'face_index': 0, 'source_filename': '6797547230208265478_00001.jpg', 'source_is_video': False, 'source_frame_dims': (1280, 720)}}})
12/05/2021 14:44:42 MainProcess     MainThread                     train           _get_images                    INFO     Model B Directory: '/Users/server/Documents/_TRAINING_SETS/B/aligned' (398 images)
12/05/2021 14:44:42 MainProcess     MainThread                     train           _get_images                    DEBUG    Got image paths: [('a', '770 images'), ('b', '398 images')]
12/05/2021 14:44:42 MainProcess     MainThread                     train           __init__                       DEBUG    Initialized Train
12/05/2021 14:44:42 MainProcess     MainThread                     train           process                        DEBUG    Starting Training Process
12/05/2021 14:44:42 MainProcess     MainThread                     train           process                        INFO     Training data directory: /Users/server/Documents/model
12/05/2021 14:44:42 MainProcess     MainThread                     train           _start_thread                  DEBUG    Launching Trainer thread
12/05/2021 14:44:42 MainProcess     MainThread                     multithreading  __init__                       DEBUG    Initializing MultiThread: (target: '_training', thread_count: 1)
12/05/2021 14:44:42 MainProcess     MainThread                     multithreading  __init__                       DEBUG    Initialized MultiThread: '_training'
12/05/2021 14:44:42 MainProcess     MainThread                     multithreading  start                          DEBUG    Starting thread(s): '_training'
12/05/2021 14:44:42 MainProcess     MainThread                     multithreading  start                          DEBUG    Starting thread 1 of 1: '_training_0'
12/05/2021 14:44:42 MainProcess     MainThread                     multithreading  start                          DEBUG    Started all threads '_training': 1
12/05/2021 14:44:42 MainProcess     MainThread                     train           _start_thread                  DEBUG    Launched Trainer thread
12/05/2021 14:44:42 MainProcess     MainThread                     train           _monitor                       DEBUG    Launching Monitor
12/05/2021 14:44:42 MainProcess     MainThread                     train           _monitor                       INFO     ===================================================
12/05/2021 14:44:42 MainProcess     MainThread                     train           _monitor                       INFO       Starting
12/05/2021 14:44:42 MainProcess     MainThread                     train           _monitor                       INFO       Press 'Stop' to save and quit
12/05/2021 14:44:42 MainProcess     MainThread                     train           _monitor                       INFO     ===================================================
12/05/2021 14:44:43 MainProcess     _training_0                    train           _training                      DEBUG    Commencing Training
12/05/2021 14:44:43 MainProcess     _training_0                    train           _training                      INFO     Loading data, this may take a while...
12/05/2021 14:44:43 MainProcess     _training_0                    train           _load_model                    DEBUG    Loading Model
12/05/2021 14:44:43 MainProcess     _training_0                    utils           get_folder                     DEBUG    Requested path: '/Users/server/Documents/model'
12/05/2021 14:44:43 MainProcess     _training_0                    utils           get_folder                     DEBUG    Returning: '/Users/server/Documents/model'
12/05/2021 14:44:43 MainProcess     _training_0                    plugin_loader   _import                        INFO     Loading Model from Dfl_Sae plugin...
12/05/2021 14:44:43 MainProcess     _training_0                    multithreading  run                            DEBUG    Error in thread (_training_0): cannot import name 'get_custom_objects' from 'keras.utils' (/Users/server/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/keras/utils/__init__.py)
12/05/2021 14:44:44 MainProcess     MainThread                     train           _monitor                       DEBUG    Thread error detected
12/05/2021 14:44:44 MainProcess     MainThread                     train           _monitor                       DEBUG    Closed Monitor
12/05/2021 14:44:44 MainProcess     MainThread                     train           _end_thread                    DEBUG    Ending Training thread
12/05/2021 14:44:44 MainProcess     MainThread                     train           _end_thread                    CRITICAL Error caught! Exiting...
12/05/2021 14:44:44 MainProcess     MainThread                     multithreading  join                           DEBUG    Joining Threads: '_training'
12/05/2021 14:44:44 MainProcess     MainThread                     multithreading  join                           DEBUG    Joining Thread: '_training_0'
12/05/2021 14:44:44 MainProcess     MainThread                     multithreading  join                           ERROR    Caught exception in thread: '_training_0'
Traceback (most recent call last):
  File "/Users/server/Documents/faceswap/lib/cli/launcher.py", line 182, in execute_script
    process.process()
  File "/Users/server/Documents/faceswap/scripts/train.py", line 190, in process
    self._end_thread(thread, err)
  File "/Users/server/Documents/faceswap/scripts/train.py", line 230, in _end_thread
    thread.join()
  File "/Users/server/Documents/faceswap/lib/multithreading.py", line 121, in join
    raise thread.err[1].with_traceback(thread.err[2])
  File "/Users/server/Documents/faceswap/lib/multithreading.py", line 37, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/server/Documents/faceswap/scripts/train.py", line 252, in _training
    raise err
  File "/Users/server/Documents/faceswap/scripts/train.py", line 240, in _training
    model = self._load_model()
  File "/Users/server/Documents/faceswap/scripts/train.py", line 264, in _load_model
    model = PluginLoader.get_model(self._args.trainer)(
  File "/Users/server/Documents/faceswap/plugins/plugin_loader.py", line 97, in get_model
    return PluginLoader._import("train.model", name, disable_logging)
  File "/Users/server/Documents/faceswap/plugins/plugin_loader.py", line 163, in _import
    module = import_module(mod)
  File "/Users/server/miniforge3/envs/faceswap-env/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/server/Documents/faceswap/plugins/train/model/dfl_sae.py", line 10, in <module>
    from lib.model.nn_blocks import Conv2DOutput, Conv2DBlock, ResidualBlock, UpscaleBlock
  File "/Users/server/Documents/faceswap/lib/model/__init__.py", line 6, in <module>
    from .normalization import *
  File "/Users/server/Documents/faceswap/lib/model/normalization/__init__.py", line 5, in <module>
    from .normalization_common import AdaInstanceNormalization
  File "/Users/server/Documents/faceswap/lib/model/normalization/normalization_common.py", line 10, in <module>
    from keras.utils import get_custom_objects
ImportError: cannot import name 'get_custom_objects' from 'keras.utils' (/Users/server/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/keras/utils/__init__.py)

============ System Information ============
encoding:            UTF-8
git_branch:          master
git_commits:         fb0afa2 Revert "Trick into doing GPU training using Nvidia backend setting". c212dd4 Add Apple backend. 19084be Get shared RAM info using psutil. 5187df9 Trick into doing GPU training using Nvidia backend setting. 5db622e Update install guide
gpu_cuda:            No global version found. Check Conda packages for Conda Cuda
gpu_cudnn:           No global version found. Check Conda packages for Conda cuDNN
gpu_devices:         GPU_0: Apple M1
gpu_devices_active:  GPU_0
gpu_driver:          1.0
gpu_vram:            GPU_0: 16384MB
os_machine:          arm64
os_platform:         macOS-12.0.1-arm64-arm-64bit
os_release:          21.1.0
py_command:          /Users/server/Documents/faceswap/faceswap.py train -A /Users/server/Documents/_TRAINING_SETS/A/aligned -B /Users/server/Documents/_TRAINING_SETS/B/aligned -m /Users/server/Documents/model -t dfl-sae -bs 64 -it 1000000 -s 250 -ss 25000 -ps 100 -wl -L INFO -gui
py_conda_version:    conda 4.10.3
py_implementation:   CPython
py_version:          3.8.12
py_virtual_env:      True
sys_cores:           10
sys_processor:       arm
sys_ram:             Total: 16384MB, Available: 10665MB, Used: 4360MB, Free: 8333MB

=============== Pip Packages ===============
absl-py @ file:///home/conda/feedstock_root/build_artifacts/absl-py_1606234718434/work
aiohttp @ file:///Users/runner/miniforge3/conda-bld/aiohttp_1637087375815/work
aiosignal @ file:///home/conda/feedstock_root/build_artifacts/aiosignal_1636093929600/work
astunparse @ file:///home/conda/feedstock_root/build_artifacts/astunparse_1610696312422/work
async-timeout @ file:///home/conda/feedstock_root/build_artifacts/async-timeout_1637092647930/work
attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1620387926260/work
blinker==1.4
brotlipy @ file:///Users/runner/miniforge3/conda-bld/brotlipy_1636012322014/work
cached-property @ file:///home/conda/feedstock_root/build_artifacts/cached_property_1615209429212/work
cachetools @ file:///home/conda/feedstock_root/build_artifacts/cachetools_1633010882559/work
certifi==2021.10.8
cffi @ file:///Users/runner/miniforge3/conda-bld/cffi_1636046166270/work
charset-normalizer @ file:///home/conda/feedstock_root/build_artifacts/charset-normalizer_1637858084653/work
click @ file:///Users/runner/miniforge3/conda-bld/click_1635822678136/work
colorama @ file:///home/conda/feedstock_root/build_artifacts/colorama_1602866480661/work
cryptography @ file:///Users/runner/miniforge3/conda-bld/cryptography_1636040761681/work
cycler==0.11.0
dataclasses @ file:///home/conda/feedstock_root/build_artifacts/dataclasses_1628958434797/work
ffmpy==0.2.3
flatbuffers==2.0
frozenlist @ file:///Users/runner/miniforge3/conda-bld/frozenlist_1636504246445/work
gast @ file:///home/conda/feedstock_root/build_artifacts/gast_1596839682936/work
google-auth @ file:///home/conda/feedstock_root/build_artifacts/google-auth_1629296548061/work
google-auth-oauthlib @ file:///home/conda/feedstock_root/build_artifacts/google-auth-oauthlib_1630497468950/work
google-pasta==0.2.0
grpcio @ file:///Users/runner/miniforge3/conda-bld/grpcio_1637189242005/work
h5py @ file:///Users/runner/miniforge3/conda-bld/h5py_1609497512060/work
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1609836280497/work
imageio @ file:///home/conda/feedstock_root/build_artifacts/imageio_1638534663447/work
imageio-ffmpeg @ file:///home/conda/feedstock_root/build_artifacts/imageio-ffmpeg_1629987409325/work
importlib-metadata @ file:///Users/runner/miniforge3/conda-bld/importlib-metadata_1636431683784/work
joblib @ file:///home/conda/feedstock_root/build_artifacts/joblib_1633637554808/work
keras @ file:///home/conda/feedstock_root/build_artifacts/keras_1637872120405/work/keras-2.7.0-py2.py3-none-any.whl
Keras-Preprocessing @ file:///home/conda/feedstock_root/build_artifacts/keras-preprocessing_1610713559828/work
kiwisolver==1.3.2
libclang==12.0.0
Markdown @ file:///home/conda/feedstock_root/build_artifacts/markdown_1637220118004/work
matplotlib==3.2.2
multidict @ file:///Users/runner/miniforge3/conda-bld/multidict_1636019232776/work
numpy==1.21.4
nvidia-ml-py==11.495.46
oauthlib @ file:///home/conda/feedstock_root/build_artifacts/oauthlib_1622563202229/work
olefile @ file:///home/conda/feedstock_root/build_artifacts/olefile_1602866521163/work
opencv-python==4.5.4.58
opt-einsum @ file:///home/conda/feedstock_root/build_artifacts/opt_einsum_1617859230218/work
Pillow @ file:///Users/runner/miniforge3/conda-bld/pillow_1636559170621/work
protobuf==3.19.1
psutil @ file:///Users/runner/miniforge3/conda-bld/psutil_1635822822120/work
pyasn1==0.4.8
pyasn1-modules==0.2.7
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1636257122734/work
PyJWT @ file:///home/conda/feedstock_root/build_artifacts/pyjwt_1634405536383/work
pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1633192417276/work
pyparsing==3.0.6
PySocks @ file:///Users/runner/miniforge3/conda-bld/pysocks_1635862741516/work
python-dateutil==2.8.2
pyu2f @ file:///home/conda/feedstock_root/build_artifacts/pyu2f_1604248910016/work
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1637771257551/work
requests-oauthlib @ file:///home/conda/feedstock_root/build_artifacts/requests-oauthlib_1595492159598/work
rsa @ file:///home/conda/feedstock_root/build_artifacts/rsa_1637781155505/work
scikit-learn @ file:///Users/runner/miniforge3/conda-bld/scikit-learn_1636784348537/work
scipy @ file:///Users/runner/miniforge3/conda-bld/scipy_1637806815742/work
six @ file:///home/conda/feedstock_root/build_artifacts/six_1590081179328/work
tensorboard @ file:///home/conda/feedstock_root/build_artifacts/tensorboard_1629677129676/work/tensorboard-2.6.0-py3-none-any.whl
tensorboard-data-server @ file:///Users/runner/miniforge3/conda-bld/tensorboard-data-server_1636046148099/work/tensorboard_data_server-0.6.0-py3-none-macosx_11_0_arm64.whl
tensorboard-plugin-wit @ file:///home/conda/feedstock_root/build_artifacts/tensorboard-plugin-wit_1611075653546/work/tensorboard_plugin_wit-1.8.0-py3-none-any.whl
tensorflow-estimator==2.7.0
tensorflow-macos==2.7.0
tensorflow-metal==0.3.0
termcolor==1.1.0
threadpoolctl @ file:///home/conda/feedstock_root/build_artifacts/threadpoolctl_1633102299089/work
tqdm @ file:///home/conda/feedstock_root/build_artifacts/tqdm_1632160078689/work
typing-extensions @ file:///home/conda/feedstock_root/build_artifacts/typing_extensions_1602702424206/work
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1632350318291/work
Werkzeug @ file:///home/conda/feedstock_root/build_artifacts/werkzeug_1621518206714/work
wrapt @ file:///Users/runner/miniforge3/conda-bld/wrapt_1624971819058/work
yarl @ file:///Users/runner/miniforge3/conda-bld/yarl_1636047129772/work
zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1633302054558/work

============== Conda Packages ==============
# packages in environment at /Users/server/miniforge3/envs/faceswap-env:
#
# Name                    Version                   Build  Channel
absl-py                   0.10.0             pyhd8ed1ab_1    conda-forge
aiohttp                   3.8.1            py38hea4295b_0    conda-forge
aiosignal                 1.2.0              pyhd8ed1ab_0    conda-forge
aom                       3.2.0                hc470f4d_2    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-timeout             4.0.1              pyhd8ed1ab_0    conda-forge
attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
blinker                   1.4                        py_1    conda-forge
brotlipy                  0.7.0           py38hea4295b_1003    conda-forge
bzip2                     1.0.8                h3422bc3_4    conda-forge
c-ares                    1.18.1               h3422bc3_0    conda-forge
ca-certificates           2021.10.8            h4653dfc_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                4.2.4              pyhd8ed1ab_0    conda-forge
certifi                   2021.10.8        py38h10201cd_1    conda-forge
cffi                      1.15.0           py38hc67bbb8_0    conda-forge
charset-normalizer        2.0.8              pyhd8ed1ab_0    conda-forge
click                     8.0.3            py38h10201cd_1    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              35.0.0           py38h10d4710_2    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
ffmpeg                    4.4.1                hdbd4ad8_0    conda-forge
flatbuffers               2.0                      pypi_0    pypi
freetype                  2.10.4               h17b34a0_1    conda-forge
frozenlist                1.2.0            py38hea4295b_1    conda-forge
gast                      0.4.0              pyh9f0ad1d_0    conda-forge
gettext                   0.19.8.1          h049c9fb_1008    conda-forge
gmp                       6.2.1                h9f76cd9_0    conda-forge
gnutls                    3.6.13               h706517b_1    conda-forge
google-auth               1.35.0             pyh6c4a22f_0    conda-forge
google-auth-oauthlib      0.4.6              pyhd8ed1ab_0    conda-forge
google-pasta              0.2.0              pyh8c360ce_0    conda-forge
grpcio                    1.42.0           py38h69ee544_0    conda-forge
h5py                      3.1.0           nompi_py38h032b01a_100    conda-forge
hdf5                      1.10.6          nompi_h0fc092c_1114    conda-forge
icu                       69.1                 hbdafb3b_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imageio                   2.13.1             pyhd8ed1ab_1    conda-forge
imageio-ffmpeg            0.4.5              pyhd8ed1ab_0    conda-forge
importlib-metadata        4.8.2            py38h10201cd_0    conda-forge
jbig                      2.1               h3422bc3_2003    conda-forge
joblib                    1.1.0              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h27ca646_0    conda-forge
keras                     2.7.0              pyhd8ed1ab_0    conda-forge
keras-preprocessing       1.1.2              pyhd8ed1ab_0    conda-forge
krb5                      1.19.2               hd92b7a7_3    conda-forge
lame                      3.100             h27ca646_1001    conda-forge
lcms2                     2.12                 had6a04f_0    conda-forge
lerc                      3.0                  hbdafb3b_0    conda-forge
libblas                   3.9.0           12_osxarm64_openblas    conda-forge
libcblas                  3.9.0           12_osxarm64_openblas    conda-forge
libclang                  12.0.0                   pypi_0    pypi
libcurl                   7.80.0               h8fe1914_1    conda-forge
libcxx                    12.0.1               h168391b_0    conda-forge
libdeflate                1.8                  h3422bc3_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h642e427_1    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0.dev0      11_0_1_hf114ba7_23    conda-forge
libgfortran5              11.0.1.dev0         hf114ba7_23    conda-forge
libiconv                  1.16                 h642e427_0    conda-forge
liblapack                 3.9.0           12_osxarm64_openblas    conda-forge
libllvm11                 11.1.0               h93073aa_2    conda-forge
libnghttp2                1.43.0               he4cd7f6_1    conda-forge
libopenblas               0.3.18          openmp_h5dd58f0_0    conda-forge
libpng                    1.6.37               hf7e6567_2    conda-forge
libprotobuf               3.19.1               hccf11d3_0    conda-forge
libssh2                   1.10.0               hb80f160_2    conda-forge
libtiff                   4.3.0                h74060c4_2    conda-forge
libvpx                    1.11.0               hc470f4d_3    conda-forge
libwebp-base              1.2.1                h3422bc3_0    conda-forge
libxml2                   2.9.12               hedbfbf4_1    conda-forge
libzlib                   1.2.11            hee7b306_1013    conda-forge
llvm-openmp               12.0.1               hf3c4609_1    conda-forge
lz4-c                     1.9.3                hbdafb3b_1    conda-forge
markdown                  3.3.6              pyhd8ed1ab_0    conda-forge
multidict                 5.2.0            py38hea4295b_1    conda-forge
ncurses                   6.2                  h9aa5885_4    conda-forge
nettle                    3.6                  hc6a1b29_0    conda-forge
numpy                     1.19.5           py38hbf7bb01_2    conda-forge
oauthlib                  3.1.1              pyhd8ed1ab_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openh264                  2.1.1                habe5f53_0    conda-forge
openjpeg                  2.4.0                h062765e_1    conda-forge
openssl                   1.1.1l               h3422bc3_0    conda-forge
opt_einsum                3.3.0              pyhd8ed1ab_1    conda-forge
pillow                    8.4.0            py38h02acf36_0    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
protobuf                  3.19.1           py38h6f2b01f_1    conda-forge
psutil                    5.8.0            py38hea4295b_2    conda-forge
pyasn1                    0.4.8                      py_0    conda-forge
pyasn1-modules            0.2.7                      py_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyjwt                     2.3.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 21.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py38h10201cd_4    conda-forge
python                    3.8.12          hab31e5c_2_cpython    conda-forge
python_abi                3.8                      2_cp38    conda-forge
pyu2f                     0.1.5              pyhd8ed1ab_0    conda-forge
readline                  8.1                  hedafd6a_0    conda-forge
requests                  2.26.0             pyhd8ed1ab_1    conda-forge
requests-oauthlib         1.3.0              pyh9f0ad1d_0    conda-forge
rsa                       4.8                pyhd8ed1ab_0    conda-forge
scikit-learn              1.0.1            py38h2cd4032_2    conda-forge
scipy                     1.7.3            py38hd0c9ec0_0    conda-forge
setuptools                59.4.0           py38h10201cd_0    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sqlite                    3.37.0               h72a2b83_0    conda-forge
svt-av1                   0.8.7                hc470f4d_1    conda-forge
tensorboard               2.6.0              pyhd8ed1ab_1    conda-forge
tensorboard-data-server   0.6.0            py38h10d4710_1    conda-forge
tensorboard-plugin-wit    1.8.0              pyh44b312d_0    conda-forge
tensorflow-deps           2.7.0                         0    apple
tensorflow-estimator      2.7.0                    pypi_0    pypi
tensorflow-macos          2.7.0                    pypi_0    pypi
tensorflow-metal          0.3.0                    pypi_0    pypi
termcolor                 1.1.0                      py_2    conda-forge
threadpoolctl             3.0.0              pyh8a188c0_0    conda-forge
tk                        8.6.11               he1e0b03_1    conda-forge
tqdm                      4.62.3             pyhd8ed1ab_0    conda-forge
typing-extensions         3.7.4.3                       0    conda-forge
typing_extensions         3.7.4.3                    py_0    conda-forge
urllib3                   1.26.7             pyhd8ed1ab_0    conda-forge
werkzeug                  2.0.1              pyhd8ed1ab_0    conda-forge
wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
wrapt                     1.12.1           py38hea4295b_3    conda-forge
x264                      1!161.3030           h3422bc3_1    conda-forge
x265                      3.5                  h666519e_1    conda-forge
xz                        5.2.5                h642e427_1    conda-forge
yarl                      1.7.2            py38hea4295b_1    conda-forge
zipp                      3.6.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            hee7b306_1013    conda-forge
zstd                      1.5.0                h861e0a7_0    conda-forge

================= Configs ==================
--------- convert.ini ---------

[color.color_transfer]
clip:                     True
preserve_paper:           True

[color.match_hist]
threshold:                99.0

[color.manual_balance]
colorspace:               HSV
balance_1:                0.0
balance_2:                0.0
balance_3:                0.0
contrast:                 0.0
brightness:               0.0

[writer.pillow]
format:                   png
draw_transparent:         False
optimize:                 False
gif_interlace:            True
jpg_quality:              75
png_compress_level:       3
tif_compression:          tiff_deflate

[writer.ffmpeg]
container:                mp4
codec:                    libx264
crf:                      23
preset:                   medium
tune:                     none
profile:                  auto
level:                    auto
skip_mux:                 False

[writer.gif]
fps:                      25
loop:                     0
palettesize:              256
subrectangles:            False

[writer.opencv]
format:                   png
draw_transparent:         False
jpg_quality:              75
png_compress_level:       3

[mask.mask_blend]
type:                     normalized
kernel_size:              3
passes:                   4
threshold:                4
erosion:                  0.0

[mask.box_blend]
type:                     gaussian
distance:                 11.0
radius:                   5.0
passes:                   1

[scaling.sharpen]
method:                   none
amount:                   150
radius:                   0.3
threshold:                5.0

--------- gui.ini ---------

[global]
fullscreen:               False
tab:                      extract
options_panel_width:      30
console_panel_height:     20
icon_size:                14
font:                     default
font_size:                9
autosave_last_session:    prompt
timeout:                  120
auto_load_model_stats:    True

--------- .faceswap ---------
backend:                  apple

--------- extract.ini ---------

[global]
allow_growth:             False

[detect.mtcnn]
minsize:                  20
scalefactor:              0.709
batch-size:               8
threshold_1:              0.6
threshold_2:              0.7
threshold_3:              0.7

[detect.cv2_dnn]
confidence:               50

[detect.s3fd]
confidence:               70
batch-size:               4

[align.fan]
batch-size:               12

[mask.unet_dfl]
batch-size:               8

[mask.vgg_obstructed]
batch-size:               2

[mask.vgg_clear]
batch-size:               6

[mask.bisenet_fp]
batch-size:               8
include_ears:             False
include_hair:             False
include_glasses:          True

--------- train.ini ---------

[global]
centering:                face
coverage:                 87.5
icnr_init:                False
conv_aware_init:          False
optimizer:                adam
learning_rate:            5e-05
epsilon_exponent:         -7
reflect_padding:          False
allow_growth:             False
mixed_precision:          False
nan_protection:           True
convert_batchsize:        16

[global.loss]
loss_function:            ssim
mask_loss_function:       mse
l2_reg_term:              100
eye_multiplier:           3
mouth_multiplier:         2
penalized_mask_loss:      True
mask_type:                extended
mask_blur_kernel:         3
mask_threshold:           4
learn_mask:               False

[model.phaze_a]
output_size:              128
shared_fc:                none
enable_gblock:            True
split_fc:                 True
split_gblock:             False
split_decoders:           False
enc_architecture:         fs_original
enc_scaling:              40
enc_load_weights:         True
bottleneck_type:          dense
bottleneck_norm:          none
bottleneck_size:          1024
bottleneck_in_encoder:    True
fc_depth:                 1
fc_min_filters:           1024
fc_max_filters:           1024
fc_dimensions:            4
fc_filter_slope:          -0.5
fc_dropout:               0.0
fc_upsampler:             upsample2d
fc_upsamples:             1
fc_upsample_filters:      512
fc_gblock_depth:          3
fc_gblock_min_nodes:      512
fc_gblock_max_nodes:      512
fc_gblock_filter_slope:   -0.5
fc_gblock_dropout:        0.0
dec_upscale_method:       subpixel
dec_norm:                 none
dec_min_filters:          64
dec_max_filters:          512
dec_filter_slope:         -0.45
dec_res_blocks:           1
dec_output_kernel:        5
dec_gaussian:             True
dec_skip_last_residual:   True
freeze_layers:            keras_encoder
load_layers:              encoder
fs_original_depth:        4
fs_original_min_filters:  128
fs_original_max_filters:  1024
mobilenet_width:          1.0
mobilenet_depth:          1
mobilenet_dropout:        0.001

[model.realface]
input_size:               64
output_size:              128
dense_nodes:              1536
complexity_encoder:       128
complexity_decoder:       512

[model.dfl_sae]
input_size:               128
clipnorm:                 True
architecture:             df
autoencoder_dims:         0
encoder_dims:             42
decoder_dims:             21
multiscale_decoder:       False

[model.unbalanced]
input_size:               128
lowmem:                   False
clipnorm:                 True
nodes:                    1024
complexity_encoder:       128
complexity_decoder_a:     384
complexity_decoder_b:     512

[model.dlight]
features:                 best
details:                  good
output_size:              256

[model.villain]
lowmem:                   False

[model.dfaker]
output_size:              128

[model.original]
lowmem:                   False

[model.dfl_h128]
lowmem:                   False

[trainer.original]
preview_images:           14
zoom_amount:              5
rotation_range:           10
shift_range:              5
flip_chance:              50
color_lightness:          30
color_ab:                 8
color_clahe_chance:       50
color_clahe_max_size:     4

Not sure if this is related to a change in Tensorflow version 2.7? I tried changing the line

Code: Select all

from keras.utils import get_custom_objects

to

Code: Select all

from tensorflow.keras.utils import get_custom_objects

and a couple of other places. Now training actually runs, the training preview appears and I'm seeing GPU usage in the Activity Monitor! But after a few seconds, activity drops and training seems to be stuck.
Image


User avatar
morningcake
Posts: 1
Joined: Fri Feb 11, 2022 8:14 pm

Re: Working on Faceswap for M1 Mac

Post by morningcake »

Hi, great job! Did earn new results?

I tried my luck in the past as well by installing several different librairies.
It ended up showing the training GUI and showing the faces.

But with every iteration, the faces were getting blurrier and blurrier..


User avatar
artisan
Posts: 1
Joined: Sat Feb 12, 2022 1:22 am

Re: Working on Faceswap for M1 Mac

Post by artisan »

Sounds like you're making some progress. I was hoping the M1 would be able to run FS. TBD.


User avatar
geewiz94
Posts: 5
Joined: Wed Nov 24, 2021 8:17 pm

Re: Working on Faceswap for M1 Mac

Post by geewiz94 »

Nothing new from my side, I think FS needs to have Python 3.9 and/or Tensorflow 2.7.0 support for this to properly work. I don't have enough Python/Tensorflow experience to implement this myself, so I'm waiting for a FS update before I continue to test on M1.

The tensorflow-macos package is on the bleeding edge and I couldn't get to install earlier versions on M1. Fastcluster is also an obstacle, the install looks very convoluted, but I might try that in the future.


User avatar
deepfiction
Posts: 1
Joined: Thu Apr 14, 2022 8:37 pm

Re: Working on Faceswap for M1 Mac

Post by deepfiction »

I need you seriously. I'm getting this error:

Code: Select all

Setting Faceswap backend to CPU
Traceback (most recent call last):
  File "faceswap.py", line 6, in <module>
    from lib.cli import args as cli_args
  File "/Users/myusername/faceswap/lib/cli/args.py", line 13, in <module>
    from lib.gpu_stats import GPUStats
  File "/Users/myusername/faceswap/lib/gpu_stats.py", line 17, in <module>
    import pynvx  # pylint: disable=import-error
ModuleNotFoundError: No module named 'pynvx'
(faceswap-env) Oguz-MacBook-Pro:faceswap myusername$ 

I tried to install pynvx by pip install pynvx but I'm getting this

Code: Select all

Collecting pynvx
  Using cached pynvx-1.0.0.tar.gz (150 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pynvx
  Building wheel for pynvx (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [78 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-11.0-arm64-cpython-38
      creating build/lib.macosx-11.0-arm64-cpython-38/pynvx
      copying pynvx/pynvml.py -> build/lib.macosx-11.0-arm64-cpython-38/pynvx
      copying pynvx/__init__.py -> build/lib.macosx-11.0-arm64-cpython-38/pynvx
      running build_ext
      -- The C compiler identification is AppleClang 12.0.5.12050022
      -- The CXX compiler identification is AppleClang 12.0.5.12050022
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found PythonInterp: /Users/oguzznamal/miniforge3/envs/faceswap-env/bin/python3.8 (found version "3.8.13")
      -- Found PythonLibs: /Users/oguzznamal/miniforge3/envs/faceswap-env/lib/libpython3.8.dylib
      -- Performing Test HAS_CPP14_FLAG
      -- Performing Test HAS_CPP14_FLAG - Success
      -- pybind11 v2.3.dev0
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- LTO enabled
      CMake Error at /Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/FindCUDA.cmake:859 (message):
        Specify CUDA_TOOLKIT_ROOT_DIR
      Call Stack (most recent call first):
        CMakeLists.txt:8 (find_package)
      
      
      -- Configuring incomplete, errors occurred!
      See also "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/build/temp.macosx-11.0-arm64-cpython-38/CMakeFiles/CMakeOutput.log".
      See also "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/build/temp.macosx-11.0-arm64-cpython-38/CMakeFiles/CMakeError.log".
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/setup.py", line 68, in <module>
          setup(
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 290, in run
          self.run_command('build')
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 136, in run
          self.run_command(cmd_name)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/setup.py", line 32, in run
          self.build_extension(ext)
        File "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/setup.py", line 56, in build_extension
          subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/build/lib.macosx-11.0-arm64-cpython-38', '-DPYTHON_EXECUTABLE=/Users/oguzznamal/miniforge3/envs/faceswap-env/bin/python3.8', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pynvx
  Running setup.py clean for pynvx
Failed to build pynvx
Installing collected packages: pynvx
  Running setup.py install for pynvx ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for pynvx did not run successfully.
  │ exit code: 1
  ╰─> [82 lines of output]
      running install
      /Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-11.0-arm64-cpython-38
      creating build/lib.macosx-11.0-arm64-cpython-38/pynvx
      copying pynvx/pynvml.py -> build/lib.macosx-11.0-arm64-cpython-38/pynvx
      copying pynvx/__init__.py -> build/lib.macosx-11.0-arm64-cpython-38/pynvx
      running build_ext
      -- The C compiler identification is AppleClang 12.0.5.12050022
      -- The CXX compiler identification is AppleClang 12.0.5.12050022
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found PythonInterp: /Users/oguzznamal/miniforge3/envs/faceswap-env/bin/python3.8 (found version "3.8.13")
      -- Found PythonLibs: /Users/oguzznamal/miniforge3/envs/faceswap-env/lib/libpython3.8.dylib
      -- Performing Test HAS_CPP14_FLAG
      -- Performing Test HAS_CPP14_FLAG - Success
      -- pybind11 v2.3.dev0
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- LTO enabled
      CMake Error at /Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/FindCUDA.cmake:859 (message):
        Specify CUDA_TOOLKIT_ROOT_DIR
      Call Stack (most recent call first):
        CMakeLists.txt:8 (find_package)
      
      
      -- Configuring incomplete, errors occurred!
      See also "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/build/temp.macosx-11.0-arm64-cpython-38/CMakeFiles/CMakeOutput.log".
      See also "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/build/temp.macosx-11.0-arm64-cpython-38/CMakeFiles/CMakeError.log".
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/setup.py", line 68, in <module>
          setup(
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/command/install.py", line 68, in run
          return orig.install.run(self)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/command/install.py", line 670, in run
          self.run_command('build')
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 136, in run
          self.run_command(cmd_name)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/setup.py", line 32, in run
          self.build_extension(ext)
        File "/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/setup.py", line 56, in build_extension
          subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
        File "/Users/oguzznamal/miniforge3/envs/faceswap-env/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/6r/8m21w6hs2nvgr6yprkb711fc0000gp/T/pip-install-x1kx50z_/pynvx_1f7840d37afa4a0f8f19892112ea5eab/build/lib.macosx-11.0-arm64-cpython-38', '-DPYTHON_EXECUTABLE=/Users/oguzznamal/miniforge3/envs/faceswap-env/bin/python3.8', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pynvx

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I really need help and I can pay you for this.


User avatar
geewiz94
Posts: 5
Joined: Wed Nov 24, 2021 8:17 pm

Re: Working on Faceswap for M1 Mac

Post by geewiz94 »

Make sure you're using the right version. The changes for M1 are not yet merged into the main repo. Try using this fork and check the install instructions:
https://github.com/geewiz94/faceswap/tree/patch-1

I ran some tests with the version above (credit to daniellivingston), now all the models seem to work, except for Phaze-A with Stojo preset. There's some dev talk here:
https://github.com/deepfakes/faceswap/issues/1197


User avatar
geewiz94
Posts: 5
Joined: Wed Nov 24, 2021 8:17 pm

Re: Working on Faceswap for M1 Mac

Post by geewiz94 »

Good news! M1 support has now been merged into the main branch :D
See the first post above.


Post Reply