davisking/dlib

[Bug]: Bus error: 10

Closed this issue · 4 comments

What Operating System(s) are you seeing this problem on?

macOS (Apple Silicon)

dlib version

19.24.6

Python version

3.10.13

Compiler

pip install dlib

Expected Behavior

The following code can execute normally

shape = dlib.shape_predictor(path_of_lm)
t = list(shape.parts())

Current Behavior

The following error occurred
Bus error: 10

Steps to Reproduce

nothing

Anything else?

The code needs to be modified as follows in order to execute normally. Skipped the last part。Additionally, I am using MacBook Pro M3,macos 14.5 (23F79)

shape = dlib.shape_predictor(path_of_lm)
t = []
parts = shape.parts()
for i, part in enumerate(parts):
    if i == len(parts) - 1:
        break  
    t.append(part)

I don't follow the example. dlib.shape_predictor(filename) loads a shape predictor model from a file named filename. It doesn't return a shape. And the object it returns has no .parts() method. So the error you should get there would be shape_predictor' object has no attribute 'parts'

@davisking The complete code is here:https://github.com/tomy128/video-retalking/blob/m1/utils/ffhq_preprocess.py
line 49。
It may be a compatibility issue,The code can only run on m1, but not on m3

@davisking Thank you for your answer!