簡體   English   中英

dlib cnn_face_detection_model_v1 Python錯誤

[英]dlib cnn_face_detection_model_v1 Python error

我正在嘗試使用dlib(v19.6)Python API使用以下代碼創建CNN人臉檢測器:

cnn_face_detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')

但是,我得到一個ArgumentError如下:

---------------------------------------------------------------------------
ArgumentError                             Traceback (most recent call last)
<ipython-input-16-c2ca0a6e8dff> in <module>()
----> 1 cnn_face_detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')

ArgumentError: Python argument types in
    cnn_face_detection_model_v1.__init__(cnn_face_detection_model_v1, str)
did not match C++ signature:
    __init__(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

我可能做錯了什么? 我不能簡單地將模型文件的文件名作為字符串傳遞嗎?

使用此新發行版,這對我有用,您的用法是正確的!

這可能意味着您要么:

  • 在安裝過程中做錯了什么
    • python setup.py install嗎? 沒錯!
  • 或者:您的python解釋器在您不知情的情況下使用了其他dlib版本

python setup.py install后出現了類似的問題,這是由於python使用了來自/opt/conda/lib/python3.6/site-packages/dlib.so的較早版本的/opt/conda/lib/python3.6/site-packages/dlib.so

做一個簡單的mv /opt/conda/lib/python3.6/site-packages/dlib.so /opt/conda/lib/python3.6/site-packages/dlib_old.so為我解決了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM