表单识别器 "Training data is missing: Could not find any training data at the given path."
Form Recognizer "Training data is missing: Could not find any training data at the given path."
我正在使用新的表单识别器工作室 (https://formrecognizer.appliedai.azure.com/studio/customform/projects) 来标记使用 SDK Version="4.0.0-beta.2" 的文件。训练模型的代码如下:
var buildModelOptions = new BuildModelOptions
{
Prefix = docType.SubFolderName,
ModelDescription = trainedModel.ModelDescription
};
BuildModelOperation operation = await _trainingClient
.StartBuildModelAsync(new Uri(_trainingDataSASUrl), trainedModel.ModelName, buildModelOptions);
Response<DocumentModel> operationResponse = await operation.WaitForCompletionAsync();
DocumentModel model = operationResponse.Value;
在方法 StartBuildModelAsync() 上不断出现如下错误:
Invalid request.
Status: 400 (Bad Request)
ErrorCode: InvalidRequest
Content:
{
"error": {
"code": "InvalidRequest",
"message": "Invalid request.",
"innererror": {
"code": "TrainingContentMissing",
"message": "Training data is missing: Could not find any training data at the given path."
}
}
}
在 BuildModelOptions.Prefix 中,我将值传递为“cfs/Lease1015”,这是来自 blob 容器的路径,blob 容器 SAS url 在“_trainingDataSASUrl”中。在 blob 中,训练文件存在于“cfs/Lease1015”下,并且在正确的大小写中指定了前缀。
请查看 github 此处报告的错误 https://github.com/Azure/azure-sdk-for-net/issues/26081 了解更多信息。
在前缀属性中添加“/”后有效。
var buildModelOptions = new BuildModelOptions
{
Prefix = docType.SubFolderName + '/', // append a slash to the subfolder name
ModelDescription = trainedModel.ModelDescription
};
我正在使用新的表单识别器工作室 (https://formrecognizer.appliedai.azure.com/studio/customform/projects) 来标记使用 SDK Version="4.0.0-beta.2" 的文件。训练模型的代码如下:
var buildModelOptions = new BuildModelOptions
{
Prefix = docType.SubFolderName,
ModelDescription = trainedModel.ModelDescription
};
BuildModelOperation operation = await _trainingClient
.StartBuildModelAsync(new Uri(_trainingDataSASUrl), trainedModel.ModelName, buildModelOptions);
Response<DocumentModel> operationResponse = await operation.WaitForCompletionAsync();
DocumentModel model = operationResponse.Value;
在方法 StartBuildModelAsync() 上不断出现如下错误:
Invalid request.
Status: 400 (Bad Request)
ErrorCode: InvalidRequest
Content:
{
"error": {
"code": "InvalidRequest",
"message": "Invalid request.",
"innererror": {
"code": "TrainingContentMissing",
"message": "Training data is missing: Could not find any training data at the given path."
}
}
}
在 BuildModelOptions.Prefix 中,我将值传递为“cfs/Lease1015”,这是来自 blob 容器的路径,blob 容器 SAS url 在“_trainingDataSASUrl”中。在 blob 中,训练文件存在于“cfs/Lease1015”下,并且在正确的大小写中指定了前缀。
请查看 github 此处报告的错误 https://github.com/Azure/azure-sdk-for-net/issues/26081 了解更多信息。
在前缀属性中添加“/”后有效。
var buildModelOptions = new BuildModelOptions
{
Prefix = docType.SubFolderName + '/', // append a slash to the subfolder name
ModelDescription = trainedModel.ModelDescription
};