

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 了解培訓和測試驗證結果清單檔案
<a name="tm-debugging-scope-json-line"></a>

在訓練期間，Amazon Rekognition 自訂標籤會建立驗證結果清單檔案，以保留非終端 JSON Line 錯誤。驗證結果清單檔案是訓練和測試資料集的複本，並新增了錯誤資訊。訓練完成後，您可以存取驗證清單檔案。如需詳細資訊，請參閱[取得驗證結果](tm-debugging-getting-validation-data.md)。Amazon Rekognition 自訂標籤也會建立清單檔案摘要，其中會包含 JSON Line 錯誤的概觀資訊，例如錯誤位置和 JSON Line 錯誤計數。如需詳細資訊，請參閱[了解清單檔案摘要](tm-debugging-summary.md)。

**注意**  
只有在沒有 [終端機資訊清單檔案錯誤清單](tm-debugging.md#tm-error-category-terminal) 的情況下，才會建立驗證結果 (訓練與測試驗證結果清單檔案和清單檔案摘要)。

清單檔案會包含資料集中每個影像的 JSON Lines。在驗證結果清單檔案中，JSON Line 錯誤資訊會新增到發生錯誤的 JSON Lines。

JSON Line 錯誤指和單一影像相關的非終結錯誤。非終端驗證錯誤可能會使整個 JSON Line 或只有一部分失效。例如，如果 JSON Line 中參考的影像不是 PNG 或 JPG 格式，即會發生 [ERROR\$1INVALID\$1IMAGE](tm-debugging-json-line-errors.md#tm-error-ERROR_INVALID_IMAGE) 錯誤，而且整個 JSON Line 會從訓練中排除。使用其他有效的 JSON Lines 繼續訓練。

在 JSON Line 中，錯誤可能表示 JSON Line 仍可以用於訓練。例如，如果與標籤相關聯的四個週框方塊之一的左側值為負值，則仍會使用其他有效的週框方塊來訓練模型。針對無效的週框方塊 ([ERROR\$1INVALID\$1BOUNDING\$1BOX](tm-debugging-json-line-errors.md#tm-error-ERROR_INVALID_BOUNDING_BOX)) 傳回 JSON Line 錯誤資訊。在此範例中，錯誤資訊會新增至發生錯誤的 `annotation` 物件。

警告錯誤 (例如 [WARNING\$1NO\$1ANNOTATIONS](tm-debugging-json-line-errors.md#tm-warning-WARNING_NO_ANNOTATIONS)) 不會用於訓練，並在清單檔案摘要中會計為忽略的 JSON Lines (`ignored_json_lines`)。如需詳細資訊，請參閱[了解清單檔案摘要](tm-debugging-summary.md)。此外，忽略的 JSON Lines 不會計入訓練和測試的 20% 錯誤閾值。

 如需有關特定非終端資料驗證錯誤的資訊，請參閱 [非終端 JSON Line 驗證錯誤](tm-debugging-json-line-errors.md)。

**注意**  
如果資料驗證錯誤太多，則會停止訓練，並在清單檔案摘要中回報 [ERROR\$1TOO\$1MANY\$1INVALID\$1ROWS\$1IN\$1MANIFEST](tm-debugging-aggregate-errors.md#tm-error-ERROR_TOO_MANY_INVALID_ROWS_IN_MANIFEST) 終端錯誤。

如需更正 JSON Line 錯誤的資訊，請參閱 [修正訓練錯誤](tm-debugging-fixing-validation-errors.md)。



## JSON Line 錯誤格式
<a name="tm-json-line-error-format"></a>

Amazon Rekognition 自訂標籤會將非終端驗證錯誤資訊新增至影像層級和物件本地化格式 JSON Lines。如需詳細資訊，請參閱[建立清單檔案](md-create-manifest-file.md)。

### 影像層級錯誤
<a name="tm-debugging-image-level"></a>

下面的範例會顯示影像層級 JSON Line 中的 `Error` 陣列。有兩組錯誤。與標籤屬性中繼資料 (在此範例中為 sport-metadata) 相關的錯誤以及與影像相關的錯誤。錯誤包括錯誤代碼 (代碼)、錯誤訊息 (訊息)。如需詳細資訊，請參閱[在資訊清單檔案中匯入影像層級標籤](md-create-manifest-file-classification.md)。

```
{
    "source-ref": String,
    "sport": Number,
    "sport-metadata": {
        "class-name": String,
        "confidence": Float,
        "type": String,
        "job-name": String,
        "human-annotated": String,
        "creation-date": String,
        "errors": [
            {
                "code": String, # error codes for label
                "message": String # Description and additional contextual details of the error
            }
        ] 
    },
    "errors": [
        {
            "code": String, # error codes for image
            "message": String # Description and additional contextual details of the error
        }
    ]
}
```

### 物件本地化錯誤
<a name="tm-debugging-object-localization"></a>

下面的範例會顯示物件本地化 JSON Line 中的錯誤陣列。JSON Line 會包含下列 JSON Line 區段中欄位的 `Errors` 陣列資訊。每個 `Error` 物件都包含錯誤代碼和錯誤訊息。
+ *標籤屬性* — 標籤屬性欄位的錯誤。請參閱範例中的 `bounding-box`。
+ *註釋* — 註釋錯誤 (週框方塊) 存放在標籤屬性內的 `annotations` 陣列中。
+ *標籤屬性中繼資料* — 標籤屬性中繼資料的錯誤。請參閱範例中的 `bounding-box-metadata`。
+ *image* — 與標籤屬性、註釋和標籤屬性中繼資料欄位無關的錯誤。

如需詳細資訊，請參閱[資訊清單檔案中的物件當地語系化](md-create-manifest-file-object-detection.md)。

```
{
    "source-ref": String,
    "bounding-box": {
        "image_size": [
            {
                "width": Int,
                "height": Int,
                "depth":Int,
            }
        ],
        "annotations": [
            {
                "class_id": Int,
                "left": Int,
                "top": Int,
                "width": Int,
                "height": Int,
                "errors": [   # annotation field errors
                    {
                        "code": String, # annotation field error code
                        "message": String # Description and additional contextual details of the error
                    }
                ]
            }
        ],
        "errors": [ #label attribute field errors
            {
                "code": String, # error code
                "message": String # Description and additional contextual details of the error
            }
        ] 
    },
    "bounding-box-metadata": {
        "objects": [
            {
                "confidence": Float
            }
        ],
        "class-map": {
            String: String
        }, 
        "type": String,
        "human-annotated": String,
        "creation-date": String,
        "job-name": String,
        "errors": [  #metadata field errors
            {
                "code": String, # error code
                "message": String # Description and additional contextual details of the error
            }
        ] 
    },
   "errors": [  # image errors
        {
            "code": String, # error code
            "message": String # Description and additional contextual details of the error
        }
    ] 
 }
```

## JSON Line 錯誤的範例
<a name="tm-debugging-scope-json-line-example"></a>

下列物件本地化 JSON Line (格式化以供讀取) 顯示 [ERROR\$1BOUNDING\$1BOX\$1TOO\$1SMALL](tm-debugging-json-line-errors.md#tm-error-ERROR_BOUNDING_BOX_TOO_SMALL) 錯誤。在此範例中，週框方塊的尺寸 (高度和寬度) 不大於 1 x 1。

```
{
    "source-ref": "s3://bucket/Manifests/images/199940-1791.jpg",
    "bounding-box": {
        "image_size": [
            {
                "width": 3000,
                "height": 3000,
                "depth": 3
            }
        ],
        "annotations": [
            {
                "class_id": 1,
                "top": 0,
                "left": 0,
                "width": 1,
                "height": 1, 
                "errors": [
                    {
                        "code": "ERROR_BOUNDING_BOX_TOO_SMALL",
                        "message": "The height and width of the bounding box is too small."
                    }
                ]
            },
            {
                "class_id": 0,
                "top": 65,
                "left": 86,
                "width": 220,
                "height": 334
            }
        ]
    },
    "bounding-box-metadata": {
        "objects": [
            {
                "confidence": 1
            },
            {
                "confidence": 1
            }
        ],
        "class-map": {
            "0": "Echo",
            "1": "Echo Dot"
        },
        "type": "groundtruth/object-detection",
        "human-annotated": "yes",
        "creation-date": "2019-11-20T02:57:28.288286",
        "job-name": "my job"
    }
}
```