2017-04-08 46 views
0

我已建成使用this pyimagesearch guide的OpenCV和opencv_contrib,並得到一個屬性錯誤:FaceRecognizer錯誤

AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

在試圖籤opencv_contrib這似乎是這個問題,這是我的終端顯示:

git checkout 3.2.0 
Note: checking out '3.2.0'. 

You are in 'detached HEAD' state. You can look around, make experimental 
changes and commit them, and you can discard any commits you make in this 
state without impacting any branches by performing another checkout. 

If you want to create a new branch to retain commits you create, you may 
do so (now or later) by using -b with the checkout command again. Example: 

    git checkout -b <new-branch-name> 

HEAD is now at 86342522... Merge pull request #701 from LaurentBerger:DericheFilter 

考慮到我對git和稀缺opencv知識的知識爲零,如果可能是屬性錯誤的問題,我應該如何解決分離的頭部問題?

+0

你不需要擔心,因爲您不打算直接貢獻這個contrib回購,用於構建您的OpenCV代碼,對我來說這似乎很好 – ZdaR

+0

您是否有指向此指南的鏈接,或者它是否花費某些東西? –

+0

@uav添加了鏈接。 – momo

回答

0

Considering the fact that I have zero knowledge of git and scarce knowledge of opencv, what should I do to fix the detached head if that could be the problem for the attribute error?

你是分離的頭,因爲你有簽出一個標籤名
標籤指向的提交不是最新提交,因此您處於分離的HEAD中。

這裏瞭解如何「修理」它 How to move HEAD back to a previous location? (Detached head)

,或者如果你只是想在這個標籤工作,以便檢查出來的新的分支爲幫助您展示

# check it out as master 
git checkout -b <new-branch-name>