Cloud Spanner: Statement failed: ML functions are not available in granular instances

48 views Asked by At

I am following the similarity search tutorial of Cloud Spanner, by executing the commands as outlined here:

At step 4 (generate text embeddings for source data), after executing the following:

CREATE TABLE apparels_embeddings (id string(100), embedding ARRAY<FLOAT64>)
PRIMARY KEY (id);

INSERT INTO apparels_embeddings(id, embeddings) 
SELECT CAST(id as string), embeddings.values
FROM ML.PREDICT(
MODEL text_embeddings,
   (SELECT id, content from apparels)
) ;

I receive the error:

Statement failed: ML functions are not available in granular instances

I have tried to change my instance node size, as well as making sure my instance is in central-west1 region, but nothing helped. I cannot also find any errors that explain this behaviour (see references below).

Sources:

1

There are 1 answers

0
WJA On

After due investigation, it seems that the instance used was not suitable for ML.Predict.

Upgrading it to Serverless resolved the issue. I suspect that the ML part requires dynamic resources.