Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Parameter --execution_provider=['gpu'] in module FaceSwapper is not in ['cpu'] #87

Open
alexjolig opened this issue Oct 28, 2023 · 6 comments
Labels
question 🤔Further information is requested

Comments

@alexjolig
Copy link

alexjolig commented Oct 28, 2023

Describe the bug
Everytime I try to choose a different execution provider, I face this error:
LoadingException: Parameter --execution_provider=['gpu'] in module FaceSwapper is not in ['cpu']

To Reproduce
Steps to reproduce the behavior:

python sin.py --source="cool_photo.jpg" --target="not_a_porn.mp4" --frame-processor FaceSwapper FaceEnhancer --output="result.mp4" --many-faces --execution-provider=cuda

If I choose cuda or gpu I'll face this error

Here's the full stack trace:

Traceback (most recent call last):
  File "projects/sinner/sin.py", line 55, in <module>
    Sin().run()
  File "projects/sinner/sin.py", line 46, in run
    BatchProcessingCore(parameters=self.parameters).run()
  File "projects/sinner/sinner/BatchProcessingCore.py", line 110, in run
    current_processor = BaseFrameProcessor.create(processor_name, self.parameters)
  File "projects/sinner/sinner/processors/frame/BaseFrameProcessor.py", line 26, in create
    return handler_class(**params)
  File "projects/sinner/sinner/processors/frame/FaceSwapper.py", line 97, in __init__
    super().__init__(parameters)
  File "projects/sinner/sinner/processors/frame/BaseFrameProcessor.py", line 49, in __init__
    super().__init__(self.parameters)
  File "projects/sinner/sinner/validators/AttributeLoader.py", line 60, in __init__
    raise LoadingException(self.errors)
sinner.validators.LoaderException.LoadingException: Parameter --execution_provider=['gpu'] in module FaceSwapper is not in ['cpu']
  • Laptop Info:
    MacBook Pro 2023 M2. 10-core GPU, 8-core CPU

Sanity Check

  • [* ] I have the latest code from the github repository
  • [* ] I have followed the installation guide
@alexjolig alexjolig added the bug 🪳Something isn't working label Oct 28, 2023
@pozitronik
Copy link
Owner

It is not an error. This message means that your current hardware/software configuration supports only the 'cpu' execution provider for onnx runtime.

@pozitronik pozitronik removed the bug 🪳Something isn't working label Oct 28, 2023
@alexjolig
Copy link
Author

@pozitronik So is there something I can do or it's just what it is?

@pozitronik
Copy link
Owner

I'll try to explain it as much, as I understand it myself.
There's ONNX Runtime, a framework that can run AI models on different types of providers; you can read there about.
You've installed the ONNX Runtime package that supports only the CpuProvider on your hardware (which utilizes the CPU, obviously). I suppose you have to find and install the onnxruntime-silicon package, which may support some kind of hardware acceleration.
It seems that onnxruntime-silicon builds can be found there.
I would appreciate it if you could try to check on this; I can't do it myself, as there's no Mac nearby.

@pozitronik pozitronik reopened this Oct 28, 2023
@pozitronik pozitronik added the question 🤔Further information is requested label Oct 28, 2023
@alexjolig
Copy link
Author

@pozitronik Thanks for the explanation. I'd definitely try it and let you know how it goes.

@alexjolig
Copy link
Author

alexjolig commented Oct 28, 2023

Maybe not the right thread, but just wanted to mention that since installing pyvirtualcam is not supported for Mac M1/M2, the work around is to install it from source:

pip install git+https://github.com/letmaik/pyvirtualcam

One other thing that can help is that you replace it in requirements by this:

git+https://github.com/letmaik/pyvirtualcam; platform_system == "Darwin" and platform.machine == "arm64" pyvirtualcam; platform_system != "Darwin" or platform.machine != "arm64"

I tested those solutions and they worked for me.

Maybe you can add Apple silicon hints to your README file.

@pozitronik
Copy link
Owner

Maybe you can add Apple silicon hints to your README file.

Thanks, i definitely will do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question 🤔Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants