我試圖在運行在虛擬機(VB)上的Ubuntu 12.04上運行https://github.com/Microsoft/Cognitive-Face-Python的Face API樣本。當我選擇圖像來檢測,它會發送一個請求,並收到了效果,但之後:Microsoft Face API Python poll_for_event:斷言`!xcb_xlib_threads_sequence_lost'失敗
sample/util.py:176: wxPyDeprecationWarning: Call to deprecated item EmptyImage. Use :class:`Image` instead.
wx_image = wx.EmptyImage(pil_image.width, pil_image.height)
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)`
我已經檢測到的地方,它停止:
try:
attributes = (
'age,gender,headPose,smile,facialHair,glasses,emotion,hair,'
'makeup,occlusion,accessories,blur,exposure,noise'
)
# the call
res = util.CF.face.detect(path, False, False, attributes)
faces = [model.Face(face, path) for face in res]
# ... WON'T GET HERE ...
self.face_list.SetItems(faces)
util.draw_bitmap_rectangle(self.bitmap, faces)
log_text = 'Response: Success. Detected {} face(s) in {}'.format(
len(res), path)
self.log.log(log_text)
text = '{} face(s) has been detected.'.format(len(res))
self.result.SetLabelText(text)
except util.CF.CognitiveFaceException as exp:
self.log.log('Response: {}. {}'.format(exp.code, exp.msg))
這個片段是從樣品/查看/ panel_detection.py
我已經在Ubuntu VM(12.04)上重現了這個錯誤,而且我沒有太多時間深入挖掘,但是從它的外觀來看,應用程序崩潰了wxPython中不存在的API(即當我放置一個斷點並檢查對象,我沒有看到函數),所以我懷疑這個庫的版本有問題。我下載了2.9個BTW,這是該示例告訴我們使用的一個 –