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

onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /Users/louis/Deep-Live-Cam/models/inswapper_128_fp16.onnx failed:Protobuf parsing failed. #717

Closed
LouisNguyen1409 opened this issue Oct 13, 2024 · 3 comments

Comments

@LouisNguyen1409
Copy link

Describe the bug
❯ python run.py --execution-provider coreml
2024-10-13 21:55:13.903 Python[75846:4329330] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.
OpenCV: out device of bound (0-1): 2
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 3
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 4
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 5
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 6
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 7
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 8
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 9
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 10
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 11
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 12
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 13
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 14
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 15
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 16
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 17
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 18
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 19
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 20
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 21
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 22
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 23
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 24
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 25
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 26
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 27
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 28
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 29
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 30
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 31
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 32
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 33
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 34
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 35
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 36
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 37
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 38
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 39
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 40
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 41
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 42
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 43
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 44
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 45
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 46
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 47
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 48
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 49
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 50
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 51
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 52
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 53
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 54
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 55
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 56
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 57
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 58
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 59
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 60
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 61
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 62
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 63
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 64
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 65
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 66
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 67
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 68
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 69
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 70
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 71
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 72
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 73
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 74
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 75
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 76
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 77
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 78
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 79
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 80
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 81
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 82
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 83
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 84
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 85
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 86
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 87
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 88
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 89
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 90
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 91
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 92
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 93
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 94
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 95
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 96
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 97
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 98
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-1): 99
OpenCV: camera failed to properly initialize!
2024-10-13 21:55:18.757 Python[75846:4329330] +[IMKClient subclass]: chose IMKClient_Legacy
2024-10-13 21:55:18.757 Python[75846:4329330] +[IMKInputSession subclass]: chose IMKInputSession_Legacy
2024-10-13 21:55:22.709 Python[75846:4329330] The class 'NSOpenPanel' overrides the method identifier. This method is implemented by class 'NSWindow'
Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}}
find model: /Users/louis/.insightface/models/buffalo_l/1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}}
find model: /Users/louis/.insightface/models/buffalo_l/2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}}
find model: /Users/louis/.insightface/models/buffalo_l/det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}}
find model: /Users/louis/.insightface/models/buffalo_l/genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}}
find model: /Users/louis/.insightface/models/buffalo_l/w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (640, 640)
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1948, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/myenv/lib/python3.11/site-packages/customtkinter/windows/widgets/ctk_button.py", line 554, in _clicked
self._command()
File "/Users/louis/Deep-Live-Cam/modules/ui.py", line 310, in
command=lambda: webcam_preview(
^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/modules/ui.py", line 724, in webcam_preview
create_webcam_preview(camera_index)
File "/Users/louis/Deep-Live-Cam/modules/ui.py", line 790, in create_webcam_preview
temp_frame = frame_processor.process_frame(source_image, temp_frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/modules/processors/frame/face_swapper.py", line 65, in process_frame
temp_frame = swap_face(source_face, target_face, temp_frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/modules/processors/frame/face_swapper.py", line 49, in swap_face
return get_face_swapper().get(temp_frame, target_face, source_face, paste_back=True)
^^^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/modules/processors/frame/face_swapper.py", line 44, in get_face_swapper
FACE_SWAPPER = insightface.model_zoo.get_model(model_path, providers=['CPUExecutionProvider'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/myenv/lib/python3.11/site-packages/insightface/model_zoo/model_zoo.py", line 96, in get_model
model = router.get_model(providers=providers, provider_options=provider_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/myenv/lib/python3.11/site-packages/insightface/model_zoo/model_zoo.py", line 40, in get_model
session = PickableInferenceSession(self.onnx_file, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louis/Deep-Live-Cam/myenv/lib/python3.11/site-packages/insightface/model_zoo/model_zoo.py", line 25, in init
super().init(model_path, **kwargs)
File "/Users/louis/Deep-Live-Cam/myenv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/Users/louis/Deep-Live-Cam/myenv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 480, 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 /Users/louis/Deep-Live-Cam/models/inswapper_128_fp16.onnx failed:Protobuf parsing failed.

Runing on Mac M3 Max

@KRSHH
Copy link
Collaborator

KRSHH commented Oct 13, 2024

Check this - #697

@lkraider
Copy link

lkraider commented Oct 13, 2024

For reference, you can download from here:

https://github.com/facefusion/facefusion-assets/releases/tag/models

inswapper_128.onnx 530 MB 2024-04-05T18:26:21Z
inswapper_128_fp16.onnx 265 MB 2024-04-05T18:28:23Z

@Chandra6157
Copy link

Make sure you
Have this downloaded from hugging face that will clear the error you are still doing it right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants