Google AutoML错误-错误:4 DEADLINE_EXCEEDED:已超过最后期限

我正在使用nodejs library通过以下代码将数据导入数据集中。

require("dotenv").config();
const automl = require("@google-cloud/automl");
const client = new automl.v1beta1.AutoMlClient();

(async () => {
  const projectId = `xxx`;
  const computeRegion = `us-central1`;
  const datasetId = `xxx`;
  const path = "gs://example_bucket_ocr_idr2/happiness.csv";

  // Get the full path of the dataset.
  const datasetfullId = client.datasetPath(projectId,computeRegion,datasetId);

  let inputConfig = {};
  if (path.startsWith(`bq`)) {
    // Get Bigquery URI.
    inputConfig = {
      bigquerySource: {
        inputuri: path
      }
    };
  } else {
    // Get the multiple Google Cloud Storage URIs.
    const inputuris = path.split(`,`);
    inputConfig = {
      gcsSource: {
        inputuris: inputuris
      }
    };
  }

  // Import the dataset from the input URI.
  client
    .importData({ name: datasetfullId,inputConfig: inputConfig })
    .then(responses => {
      const operation = responses[0];
      console.log(`Processing import...`);
      return operation.promise();
    })
    .then(responses => {
      // The final result of the operation.
      const operationDetails = responses[2];

      // Get the data import details.
      console.log("Data import details:");
      console.log(`\tOperation details:`);
      console.log(`\t\tName: ${operationDetails.name}`);
      console.log(`\t\tDone: ${operationDetails.done}`);
    })
    .catch(err => {
      console.error(err);
    });
})();

但是每次运行它时,都会出现 DEADLINE_EXCEEDED 错误。我一直在寻找解决方案,但直到现在都没有找到。

{ Error: 4 DEADLINE_EXCEEDED: Deadline exceeded
    at Object.callErrorFromStatus (/var/www/html/test/google-ml/node_modules/@grpc/grpc-js/build/src/call.js:30:26)
    at Http2CallStream.call.on (/var/www/html/test/google-ml/node_modules/@grpc/grpc-js/build/src/client.js:96:33)
    at Http2CallStream.emit (events.js:198:15)
    at process.nextTick (/var/www/html/test/google-ml/node_modules/@grpc/grpc-js/build/src/call-stream.js:79:22)
    at processTicksAndRejections (internal/process/task_queues.js:79:9)
  code: 4,details: 'Deadline exceeded',metadata: Metadata { internalRepr: Map {},options: {} } }

happiness.csv 文件包含以下内容:

gs://example_bucket_ocr_idr2/certs/01.pdf,certificates,post_graduation
gs://example_bucket_ocr_idr2/certs/02.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/03.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/04.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/05.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/06.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/07.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/08.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/09.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/10.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/11.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/12.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/13.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/14.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/15.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/16.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/17.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/18.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/19.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/20.pdf,post_graduation
gs://example_bucket_ocr_idr2/certs/21.pdf,post_graduation

任何帮助将不胜感激!

yhl19870621 回答:Google AutoML错误-错误:4 DEADLINE_EXCEEDED:已超过最后期限

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2952274.html

大家都在问