XSeg editor does not run on Apple M1 #77
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
./scripts/xseg.shscript fails with the following error:The root cause is that DeepFaceLap codebase is not compatible with
PyQt6which we install on M1 laptops.Is there GPU support?
The issue is tagged as "stale issue" due to no activity in 30 days. If there is no activity for 15 more days, the issue will be closed.
Bumping this because this isn't working for me too.
@chychkan were you able to find a workaround? I've tried installing
python -m pip install PyQt5, but that doesn't seem to work.@rolandinthedeep yeah, PyQt5 is not compatible with M1 and DeepFaceLab itself is not compatible with PyQt6. One possible path forward could be to upgrade DeepFaceLab to PyQt6, but I didn't have time to look into that.
I found PR #5523 that uses PySide6 instead of PyQt. I switched to this and now I'm able to train and use the XSeg editor on my M1 Mac mini!
Steps I followed
./scripts/0_setup.sh./scripts/0_setup.shhttps://github.com/chychkan/DeepFaceLab.gittohttps://github.com/jkennedyvz/DeepFaceLab.git(the source repo of the PR mentioned above)python3topython3.9(you may not need to do this, but for some reason I had to do this or else virtualenv would use Python 3.10)requirements_3.9_arm64.txttensorflow-metalPySide6./scripts/0_setup.shTemporary bug and workaround
At this point, you may run into different problems. It appears there is a bug in the latest update to
protobuf. To get around this, force a downgrade in your Python environment:source .dfl/env/bin/activatepip install 'protobuf~=3.19.0'deactivateNotes
I'm completely new to the XSeg editor, so I don't know if it is working 100%. But it does launch, loads my frames, and seems to let me save changes.
Run on Apple air M1 successfully, Thanks for your effort to fix it.
Hi,
When I tried with the PR I get this error :
(env) jbarbaud@MacBook-Air-de-Jeremy DeepFaceLab_MacOS % bash scripts/2_extract_images_from_video_data_src.sh
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
Process Process-1:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.9/3.9.13_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/opt/homebrew/Cellar/python@3.9/3.9.13_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/DeepFaceLab/core/leras/device.py", line 102, in _get_tf_devices_proc
import tensorflow
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/__init__.py", line 37, in
from tensorflow.python.tools import module_util as _module_util
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/__init__.py", line 42, in
from tensorflow.python import data
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/__init__.py", line 21, in
from tensorflow.python.data import experimental
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/experimental/__init__.py", line 95, in
from tensorflow.python.data.experimental import service
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/experimental/service/__init__.py", line 387, in
from tensorflow.python.data.experimental.ops.data_service_ops import distribute
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/experimental/ops/data_service_ops.py", line 22, in
from tensorflow.python.data.experimental.ops import compression_ops
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/experimental/ops/compression_ops.py", line 16, in
from tensorflow.python.data.util import structure
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/util/structure.py", line 22, in
from tensorflow.python.data.util import nest
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/data/util/nest.py", line 36, in
from tensorflow.python.framework import sparse_tensor as _sparse_tensor
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/framework/sparse_tensor.py", line 24, in
from tensorflow.python.framework import constant_op
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/framework/constant_op.py", line 25, in
from tensorflow.python.eager import execute
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/eager/execute.py", line 23, in
from tensorflow.python.framework import dtypes
File "/Users/jbarbaud/DeepFaceLab_MacOS/.dfl/env/lib/python3.9/site-packages/tensorflow/python/framework/dtypes.py", line 29, in
_np_bfloat16 = _pywrap_bfloat16.TF_bfloat16_type()
TypeError: Unable to convert function return value to a Python type! The signature was
() -> handle
Did you get that ?
Thank you
Hi does it still work? I also got m1 mbp
Hey @andrewortwein can you tell me which python version you use and all the versions of requirements_3.9_arm64.txt in your working solution? Because for me it works but when I train a model in the training preview, 3 from all 5 columns are grey and never update on each frame for some reason
It's been many months since I've tried that, but I do still have the env around and here are the settings it's in:
python version: 3.9
@andrewortwein Thank you very much, it works for me now!
My training previews of columns 3 , 5 and 6 are empty. And my loss is also not going down. As if model is not learning , just calculating bunch of stuff.
Did you get any solution?
Did you try to run it with SAEHD? The issue for me was I was using quick96 instead of SAEHD