【问题标题】:IBM Visual Recognition Classifier status failedIBM Visual Recognition Classifier 状态失败
【发布时间】:2016-06-23 07:14:16
【问题描述】:

我有以下用于创建简单分类器的 IBM Watson Visual Recognition Python SDK:

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(), indent=4))

{
    "classifiers": [
        {
            "status": "failed", 
            "classifier_id": "DogsVsCats_250748237", 
            "name": "Dogs Vs Cats"
        }
    ]
}

这是什么原因?

【问题讨论】:

  • 确保压缩包中只有图片。如果您打开终端,您可以使用 unzip 查看 zip 文件内容

标签: python-2.7 ibm-cloud ibm-watson visual-recognition


【解决方案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 个负例图像,它们是唯一。该服务在训练之前比较图像文件内容的哈希码,并将任何重复项仅保留在正集中。所以,去重后你的负集是空的,导致训练失败。在分类器详细信息的详细列表中应该有一个名为“解释”的附加字段,说明这可能是问题所在。

【讨论】:

    【解决方案2】:

    训练调用和数据有大小限制:

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-22
      • 2018-06-09
      相关资源
      最近更新 更多