【问题标题】:Dlib "Error deserializing object of type short"Dlib“反序列化短类型对象时出错”
【发布时间】:2017-10-14 08:11:26
【问题描述】:

我在 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

【问题讨论】:

  • 这是很常见的错误。您应该下载形状预测器模型文件并将其从存档中解压缩。下载时文件也可能损坏,其大小应为(解压缩)99693937 字节,sha1 = c7b0e0780a4fda180f75aadf654838c1866ee5fb
  • 感谢@Evgeniy,我会再次尝试下载模型,并使用给定的 sha1 进行验证。
  • 是的@Evgeniy 它工作了

标签: python raspberry-pi face-recognition dlib


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    使用命令下载

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

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

    【讨论】:

      【解决方案3】:

      希望这会对某人有所帮助。我正在使用 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")
      

      然后运行你的代码

      【讨论】:

        猜你喜欢
        • 2018-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-08
        • 1970-01-01
        • 2016-06-07
        相关资源
        最近更新 更多