【问题标题】:Form Recognizer "Training data is missing: Could not find any training data at the given path."表单识别器“缺少训练数据:在给定路径找不到任何训练数据。”
【发布时间】:2021-12-26 21:54:36
【问题描述】:

我正在使用新的表单识别器工作室 (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”中。在“cfs/Lease1015”下存在 blob 训练文件,并且前缀以正确的大小写指定。

【问题讨论】:

    标签: form-recognizer


    【解决方案1】:

    请查看这里报告的 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
    };
    

    【讨论】:

      猜你喜欢
      • 2015-01-06
      • 1970-01-01
      • 2022-11-17
      • 1970-01-01
      • 2014-07-22
      • 1970-01-01
      • 1970-01-01
      • 2018-05-01
      • 1970-01-01
      相关资源
      最近更新 更多