1
votes

Following this documentation, when requesting a batchPredict I run into this error via API

{
 "error": {
    "code": 13
    "message": "internal",
  }
}

Additionally, here's a screenshot screenshot of the error I see when I try to use the "Test & Use" tab. Neither of which are descriptive, so I'm not sure where the error lies.

In the request, I include the path to my CSV file in the Google Storage, which links to a video in the same bucket. Here's the contents of the CSV:

gs://XXXXXXXXXXXX/movie1.mov,0,inf
gs://XXXXXXXXXXXX/movie2.mov,0,inf

I also include the path to a /Results folder (in the same bucket) to save the predictions.

Code making the call:

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/',
        },
      },
    };

Please let me know if I need to provide any more detail.

1
From the screenshot, it looks like you are using the Console, are you? If not, did you try it to see if it works? Could you share the request json body without your project or model IDs but please do include the format of your modelID (how does the ID look like and where did you get it from?) (e.g. ICN124..., TBL543...) - Ksign
@Ksign I've tried both API call as well as in the console. const client = new PredictionServiceClient(); async function batchPredict() { const request = { name: client.modelPath('project-id-xxxxxx', 'us-central1', 'VOTxxxxxxxxxx'), inputConfig: { gcsSource: { inputUris: ['gs://futbolbucket/apitest.csv'], }, }, outputConfig: { gcsDestination: { outputUriPrefix: 'gs://futbolbucket/results/', }, }, }; - Emanafi
@Ksign Apologies, not sure why the code format is off. - Emanafi

1 Answers

0
votes

The possible root cause is one of those two:

  • There is an issue somewhere in your code. So, if your code is not the same as below, I suggest that you try it out (changing the appropriate variables of course).
  • There is something wrong with your model, which is the most probable root cause (as per the error message itself).

So, if it is not your code, you should create a private issue report on issue-tracker explaining your issue and giving as much details as possible on it as well as your use case and impact.
As it is private, only Googlers and you will have access to it so feel free to share your project and model IDs.

Here is what I did to try to reproduce your issue (be sure to follow the before you begin guide):

  • I have trained a model on 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.csv
  • Predicted on a couple of images on gs://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();

Note that I have also tried the REST & CMD LINE predict example.

And in both cases, it worked well and I received a correct response: Nodejs prediction's response:

Waiting for operation to complete...
Batch Prediction results saved to Cloud Storage bucket. [object Object]

REST & CMD LINE prediction's response:

{
  "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"
          ]
        }
      }
    }
  }
}