0

我有以下的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" 
     } 
    ] 
} 

什麼是這個原因?

+0

確保郵政編碼只有圖像。如果你打開一個終端,你可以使用'unzip'來查看zip文件的內容 –

回答

1
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)) 

您發送的同樣的文件內容「Husky.zip」用於同時用作正面和反面的服務反面的例子。但是,系統需要至少10個正面示例和10個負面示例圖像,這些圖像是獨特的。該服務在訓練之前比較圖像文件內容的哈希碼,並且僅在正集中留下任何副本。所以,在重複數據刪除後,你的否定集是空的,導致訓練失敗。在分類器詳細信息的詳細列表中應該有一個稱爲「解釋」的附加字段,並說這可能是問題所在。

1

有培訓通話和數據大小限制:

The service accepts a maximum of 10,000 images or 100 MB per .zip file 

The service requires a minimum of 10 images per .zip file. 

The service accepts a maximum of 256 MB per training call. 

也有尺寸限制的分級要求:

The POST /v3/classify methods accept a maximum of 20 images per batch. 

The POST /v3/detect_faces methods accept a maximum of 15 images per batch. 

The POST /v3/recognize_text methods accept a maximum of 10 images per batch. 

看到http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/visual-recognition/customizing.shtml