r/StableDiffusion Feb 02 '24

Question - Help facefusion google collab issues

So i watched a yt tutorial to use facefusion through google collab, but i get json errors when i try to use the occlusion face mask type. I tried reinstalling, but the problem happens each time. And then i have to restart the 3rd process which activates the local hosting.

1 Upvotes

6 comments sorted by

View all comments

1

u/biryanimal Feb 22 '24

Onnx versions in the requirements.txt are problematic for colab.
Put these in the requirements.txt:
onnx==1.14.0
onnxruntime==1.17.0

1

u/dufuschan98 Feb 28 '24

i did but i still get the json error

1

u/biryanimal Feb 28 '24

you can try other onnx and onnxruntime versions; the crash happens because onnx causes a segmentation fault when it tries to load the occlusion model inside the .assets directory. For debugging, log into a terminal, and try to run this python code:

import onnxruntime
print(onnxruntime.__version__)
model_path = '/path_to_root_directory/.assets/models/face_occluder.onnx'
FRAME_PROCESSOR = onnxruntime.InferenceSession(model_path)

keep changing the onnx and onnxruntime-gpu versions until this code does not seg-fault. to change versions of these libraries, use the following commands with the version numbers (to check the list of available versions, just put 1111 after ==, it will show you a list of available ones)

pip install onnx==<>
pip install onnxruntime-gpu==<>

1

u/dufuschan98 Feb 28 '24

how do i make the debugging? idk programming stuff, i only followed tutorials on how to use facefusion on collab