Dlib "Error deserializing object of type short"

Dlib "Error deserializing object of type short"

我在 dlib python 上的 pose_predictor = dlib.shape_predictor(predictor_model) 上遇到错误。

RuntimeError: Error deserializing object of type short
   while deserializing a floating point number.
   while deserializing a dlib::matrix
   while deserializing object of type std::vector
   while deserializing object of type std::vector
   while deserializing object of type std::vector

我遇到了同样的问题,重新下载了文件,现在可以了。

我从 https://github.com/JeffTrain/selfie/blob/master/shape_predictor_68_face_landmarks.dat

使用命令下载

wget -nd https://github.com/JeffTrain/selfie/raw/master/shape_predictor_68_face_landmarks.dat

从 github 下载原始文件而不是 blob。

希望这会对某人有所帮助。我正在使用 google colab,重新下载和重新上传对我不起作用。 所以我克隆了一个 git 具有形状预测器的 repo 并使用它的路径

这就是我所做的

!git clone https://github.com/nicolasmetallo/eameo-faceswap-generator

cd eameo-faceswap-generator

然后将形状预测器的路径更改为

predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")

然后运行你的代码