XSeg editor does not run on Apple M1
The ./scripts/xseg.sh script fails with the following error:
Traceback (most recent call last):
File "/Users/alex/Code/chychkan/DeepFaceLab_MacOS/.dfl/DeepFaceLab/main.py", line 343, in <module>
arguments.func(arguments)
File "/Users/alex/Code/chychkan/DeepFaceLab_MacOS/.dfl/DeepFaceLab/main.py", line 291, in process_xsegeditor
from XSegEditor import XSegEditor
File "/Users/alex/Code/chychkan/DeepFaceLab_MacOS/.dfl/DeepFaceLab/XSegEditor/XSegEditor.py", line 15, in <module>
from PyQt5.QtCore import *
ModuleNotFoundError: No module named 'PyQt5'
The root cause is that DeepFaceLap codebase is not compatible with PyQt6 which 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
- Follow all instructions in this repo's README, but stop before you run
./scripts/0_setup.sh - Edit
./scripts/0_setup.sh- Change
https://github.com/chychkan/DeepFaceLab.gittohttps://github.com/jkennedyvz/DeepFaceLab.git(the source repo of the PR mentioned above) - Change
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)
- Change
- Edit
requirements_3.9_arm64.txt- Add
tensorflow-metal - Add
PySide6
- Add
- Run
./scripts/0_setup.sh
Temporary 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:
- Run
source .dfl/env/bin/activate - Run
pip install 'protobuf~=3.19.0' - Run
deactivate
Notes
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.
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
Follow all instructions in this repo's README, but stop before you run
./scripts/0_setup.shEdit
./scripts/0_setup.sh
- Change
https://github.com/chychkan/DeepFaceLab.gittohttps://github.com/jkennedyvz/DeepFaceLab.git(the source repo of the PR mentioned above)- Change
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)Edit
requirements_3.9_arm64.txt
- Add
tensorflow-metal- Add
PySide6Run
./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:
- Run
source .dfl/env/bin/activate- Run
pip install 'protobuf~=3.19.0'- Run
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/[email protected]/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/[email protected]/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
Did you get that ? Thank you
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
Follow all instructions in this repo's README, but stop before you run
./scripts/0_setup.shEdit
./scripts/0_setup.sh
- Change
https://github.com/chychkan/DeepFaceLab.gittohttps://github.com/jkennedyvz/DeepFaceLab.git(the source repo of the PR mentioned above)- Change
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)Edit
requirements_3.9_arm64.txt
- Add
tensorflow-metal- Add
PySide6Run
./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:
- Run
source .dfl/env/bin/activate- Run
pip install 'protobuf~=3.19.0'- Run
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 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
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
#requirements_3.9_arm64.txt
numpy==1.21.4
opencv-python==4.5.5.62
numexpr==2.8.1
h5py==3.1.0
tqdm==4.62.3
colorama==0.4.4
cython==0.29.26
ffmpeg-python==0.2.0
Pillow==8.4.0
scikit-image==0.19.1
scipy==1.8.0
tensorflow-macos==2.7.0
PyQt6==6.2.3
tensorflow-metal
@andrewortwein Thank you very much, it works for me now!
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
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?
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
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