hacksider / Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image
GNU Affero General Public License v3.0
35.01k stars 4.94k forks source link

[ONNXRuntimeError] : 7 : INVALID_PROTOBUF #241

Open Aleksoooxd opened 1 month ago

Aleksoooxd commented 1 month ago

Traceback (most recent call last): File "C:\Program Files\Python311\Lib\tkinter__init.py", line 1948, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\venv\Lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked self._command() File "Deep-Live-Cam\modules\ui.py", line 104, in live_button = ctk.CTkButton(root, text='Live', cursor='hand2', command=lambda: webcam_preview()) ^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\modules\ui.py", line 281, in webcam_preview source_image = get_one_face(cv2.imread(modules.globals.source_path)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\modules\face_analyser.py", line 20, in get_one_face face = get_face_analyser().get(frame) ^^^^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\modules\face_analyser.py", line 14, in get_face_analyser FACE_ANALYSER = insightface.app.FaceAnalysis(name='buffalo_l', providers=modules.globals.execution_providers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\venv\Lib\site-packages\insightface\app\face_analysis.py", line 31, in init model = model_zoo.get_model(onnx_file, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\venv\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 96, in get_model model = router.get_model(providers=providers, provider_options=provider_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\venv\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 40, in get_model session = PickableInferenceSession(self.onnx_file, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Deep-Live-Cam\venv\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 25, in init super().init(model_path, **kwargs) File "Deep-Live-Cam\venv\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in init__ self._create_inference_session(providers, provider_options, disabled_optimizers) File "Deep-Live-Cam\venv\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 452, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from User/.insightface\models\buffalo_l\1k3d68.onnx failed:Protobuf parsing failed.

At first i forgot to install ffmpeg so while waiting for it to install i ran the program after I've commented the pre_check line which responds for checking if ffmpeg is installed. It worked fine, besides the fact that i had a black square instead of the face i wantet and it was quite laggy but after a few second i got a blue screen. So now I finally installed ffmpeg and while the "launcher" works just fine the preview obviously doesnt really load as the error would suggest. Anyone had a similar problem/ knows the fix to this issue?

William-island commented 1 month ago

May be the models from buffalo_l are damaged? I have the similar problem when using the models downloaded by powershell. I fixed it by directly download the models from the official website.

Aleksoooxd commented 1 month ago

Yep, that was it. Still getting a blue screen after couple second though :/

Aleksoooxd commented 1 month ago

Figured out the models from buffalo_I are getting damaged after each blue screen. STOPCODE: IRQL_NOT_LESS_OR_EQUAL Source: ntoskrnl.exe

luotn commented 1 month ago

I am facing a similliar issue, my output is: Deep-Live-Cam/models/inswapper_128_fp16.onnx failed:Protobuf parsing failed. The live view is a black screen due to this issue.

cyc-hahaha commented 1 month ago

我面临一个类似的问题,我的输出是:由于这个问题,实时视图是黑屏。Deep-Live-Cam/models/inswapper_128_fp16.onnx failed:Protobuf parsing failed.

me too

bunnitech commented 1 month ago

mine was working fine then suddenly stopped working, the live feed halted but the ui was ok. after restarting the ui it gives me this error.

PoPzQ commented 1 month ago

I had model files in modules folder(similar, but wrong) (Deep-Live-Cam-main\models is correct, Deep-Live-Cam-main\modules is incorrect)