IBM 视觉识别分类器状态失败
IBM Visual Recognition Classifier status failed
我有以下 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(), 缩进=4))
{
"classifiers": [
{
"status": "failed",
"classifier_id": "DogsVsCats_250748237",
"name": "Dogs Vs Cats"
}
]
}
这是什么原因?
训练调用和数据有大小限制:
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.
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 个负例图像,它们是 独特的 。该服务在训练前比较图像文件内容的哈希码,并只在正集中留下任何重复项。因此,去重后你的否定集是空的,导致训练失败。在您的分类器详细信息的详细列表中应该有一个名为 "explanation" 的附加字段,说明这可能是问题所在。
我有以下 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(), 缩进=4))
{
"classifiers": [
{
"status": "failed",
"classifier_id": "DogsVsCats_250748237",
"name": "Dogs Vs Cats"
}
]
}
这是什么原因?
训练调用和数据有大小限制:
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.
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 个负例图像,它们是 独特的 。该服务在训练前比较图像文件内容的哈希码,并只在正集中留下任何重复项。因此,去重后你的否定集是空的,导致训练失败。在您的分类器详细信息的详细列表中应该有一个名为 "explanation" 的附加字段,说明这可能是问题所在。