我有以下的IBM沃森視覺識別的Python SDK創建一個簡單的分類:IBM視覺識別分類地位未能
with open(os.path.dirname("/home/xxx/Desktop/Husky.zip/"), 'rb') as dogs, \
open(os.path.dirname("/home/xxx/Desktop/Husky.zip/"), 'rb') as cats:
print(json.dumps(visual_recognition.create_classifier('Dogs Vs Cats',dogs_positive_examples=dogs,negative_examples=cats), indent=2))
與新的分類ID的響應,其狀態如下:
{
"status": "training",
"name": "Dogs Vs Cats",
"created": "2016-06-23T06:30:00.115Z",
"classes": [
{
"class": "dogs"
}
],
"owner": "840ad7db-1e17-47bd-9961-fc43f35d2ad0",
"classifier_id": "DogsVsCats_250748237"
}
培訓狀態顯示失敗。
打印(json.dumps(visual_recognition.list_classifiers(),縮進= 4))
{
"classifiers": [
{
"status": "failed",
"classifier_id": "DogsVsCats_250748237",
"name": "Dogs Vs Cats"
}
]
}
什麼是這個原因?
確保郵政編碼只有圖像。如果你打開一個終端,你可以使用'unzip'來查看zip文件的內容 –