按照这个documentation,当通过API请求batchPredict时,我遇到了这个错误。
{
"error": {
"code": 13
"message": "internal",
}
}此外,这是我尝试使用“测试和使用”选项卡时看到的错误的屏幕截图screenshot。这两个都不是描述性的,所以我不确定错误在哪里。
在请求中,我包含了Google Storage中我的CSV文件的路径,该文件链接到同一存储桶中的视频。以下是CSV的内容:
gs://XXXXXXXXXXXX/movie1.mov,0,inf
gs://XXXXXXXXXXXX/movie2.mov,0,inf我还包括/Results文件夹的路径(在相同的存储桶中),以保存预测。
进行调用的代码:
const client = new PredictionServiceClient();
async function batchPredict() {
const request = {
name: client.modelPath('project-id-xxxxxx', 'us-central1', 'VOTxxxxxxxxxx'),
inputConfig: {
gcsSource: {
inputUris: ['gs://XXXXXXXXXXXX/apitest.csv'],
},
},
outputConfig: {
gcsDestination: {
outputUriPrefix: 'gs://XXXXXXXXXXXX/results/',
},
},
};如果我需要提供更多细节,请让我知道。
发布于 2021-04-16 17:04:35
可能的根本原因是这两个中的一个:
因此,如果它不是你的代码,你应该创建一个私有的issue report on issue-tracker来解释你的问题,并尽可能多地提供关于它的详细信息,以及你的用例和影响。
因为它是私有的,只有谷歌员工和你才能访问它,所以请随意分享你的项目和模型is。
以下是我尝试重现您的问题的方法(请务必遵循before you begin guide):
我已经在gs://YOUR_BUCKET/TRAINING.csv上训练了一个模型
TRAIN,gs://automl-video-demo-data/traffic_videos/traffic_videos_train.csv
TEST,gs://automl-video-demo-data/traffic_videos/traffic_videos_test.csvgs://YOUR_BUCKET/VIDEOS_TO_ANNOTATE.csv (InputUri)上预测了几张图片:gs://automl-video-demo-data/traffic_videos/highway_078.mp4, 0,inf
gs://automl-video-demo-data/traffic_videos/highway_079.mp4,10.00000,15.50000/**
* TODO(developer): Uncomment these variables before running the sample.
*/
const projectId = 'YOUR_PROJECT';
const location = 'us-central1';
const modelId = 'VOTXXXXXXXXXXXXXXXXXX';
const inputUri = 'gs://YOUR_BUCKET/VIDEOS_TO_ANNOTATE.csv';
const outputUri = 'gs://YOUR_BUCKET/outputs/';
// Imports the Google Cloud AutoML library
const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1;
// Instantiates a client
const client = new PredictionServiceClient();
async function batchPredict() {
// Construct request
const request = {
name: client.modelPath(projectId, location, modelId),
inputConfig: {
gcsSource: {
inputUris: [inputUri],
},
},
outputConfig: {
gcsDestination: {
outputUriPrefix: outputUri,
},
},
};
const [operation] = await client.batchPredict(request);
console.log('Waiting for operation to complete...');
// Wait for operation to complete.
const [response] = await operation.promise();
console.log(
`Batch Prediction results saved to Cloud Storage bucket. ${response}`
);
}
batchPredict();请注意,我也尝试过 predict example。
在这两种情况下,它都工作得很好,我收到了正确的响应:Nodejs prediction的响应:
Waiting for operation to complete...
Batch Prediction results saved to Cloud Storage bucket. [object Object]REST &CMD线预测的响应:
{
"name": "projects/XXXXXXXXXX/locations/us-central1/operations/VOTXXXXXXXXXXXXXXX",
"metadata": {
"@type": "type.googleapis.com/google.cloud.automl.v1beta1.OperationMetadata",
"createTime": "2021-04-16T08:09:52.102270Z",
"updateTime": "2021-04-16T08:09:52.102270Z",
"batchPredictDetails": {
"inputConfig": {
"gcsSource": {
"inputUris": [
"gs://MY_BUCKET/VIDEOS_TO_ANNOTATE.csv"
]
}
}
}
}
}https://stackoverflow.com/questions/66631534
复制相似问题