M1 使用openface

发布于:2022-08-06 ⋅ 阅读:(441) ⋅ 点赞:(0)

安装大纲

具体看图

这里要注意提前安装 Command Line Tools for Xcode。在安装完成后,如果你的mac安装过Xcode,记得要执行以下命令!

sudo xcode-select -s /Library/Developer/CommandLineTools

原因:xcode的存在会让你的mac在使用某些共享库时链接到xcode的文件目录,而问题就出在有些函数中的内容xcode并不存在!

问题1:Cmake -d失败!

如果提示你openblas找不到,请不要一直尝试卸载你的openblas。进行以下操作:

1、打开findablas.cmake并添加以下语句(注意查看你自己的版本号)。

为什么这么干,因为m1的homebrew会把文件安装在opt/homebrew目录下,并非/usr/local目录。

问题2:make出错

如果你在make编译时出现以下错误,那你大概率给自己的mac装了Xcode。

In file included from /users/Crilias/openface/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:

In file included from /users/Crilias/openface/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:27:

In file included from /opt/homebrew/include/dlib/image_processing/frontal_face_detector.h:7:

In file included from /opt/homebrew/include/dlib/image_processing/../image_processing/object_detector.h:7:

In file included from /opt/homebrew/include/dlib/image_processing/../geometry.h:10:

In file included from /opt/homebrew/include/dlib/image_processing/../geometry/point_transforms.h:9:

In file included from /opt/homebrew/include/dlib/image_processing/../geometry/../matrix/../optimization/../matrix.h:11:

In file included from /opt/homebrew/include/dlib/image_processing/../matrix/matrix_la.h:9:

/opt/homebrew/include/dlib/image_processing/../geometry/../matrix/../optimization/optimization_line_search.h:218:31: error: expected unqualified-id

if (temp == 0 || std::fpclassify(temp) == FP_SUBNORMAL)

^

/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/math.h:127:5: note: expanded from macro 'fpclassify'

( sizeof(x) == sizeof(float) ? __fpclassifyf((float)(x)) \

^

1 error generated.

make[2]: *** [lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o] Error 1

make[1]: *** [lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/

这个时候不要怕,删了Xcode就行了!!!(开玩笑哈哈哈当然不是不行)

真实做法要执行以下命令!

sudo xcode-select -s /Library/Developer/CommandLineTools

原因:xcode的存在会让你的mac在使用某些共享库时链接到xcode的文件目录,而问题就出在有些函数中的内容xcode并不存在!

本文含有隐藏内容,请 开通VIP 后查看