model predict can't json encoding error

65 views
Skip to first unread message

Dylan Finlayson

unread,
Jul 29, 2021, 1:03:08 AM7/29/21
to cloud-automl-tables-discuss
Hello everyone,
I exported my model and got the docker image running. However, every time I call the predict endpoint with json data, it is not able to read it.

The structure of my json data is like this:
{"instances:[{"col1":val1, "col2":val2,...},{"col1":val1,"col2":val2,...}...]}

It is converted from a pandas dataframe, and then converted to json using json.dumps or json.dump (I've tried both using it in file and exporting to an external json file)

Every time I get this error:

Traceback (most recent call last):
  File "src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi", line 48, in grpc._cython.cygrpc._decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 51: invalid continuation byte

Any idea what's going on?

Thanks,
Dylan

Chenyu Zhao

unread,
Aug 11, 2021, 4:45:55 PM8/11/21
to Dylan Finlayson, cloud-automl-tables-discuss
Hi Dylan,

Are there any non utf-8 characters in your prediction payload?

-Chenyu

--
You received this message because you are subscribed to the Google Groups "cloud-automl-tables-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-automl-tables...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-automl-tables-discuss/7794621e-79e7-457c-9005-b6177b45e14an%40googlegroups.com.

Helin Wang

unread,
Aug 11, 2021, 4:51:26 PM8/11/21
to Chenyu Zhao, Dylan Finlayson, cloud-automl-tables-discuss
Hi Dylan,

Are you using Vertex AutoML Tabular or AutoML Tables? How to run the exported model is a little different depending on the product.

I recall seeing a similar problem when the customer trained the model on Vertex AutoML Tabular but using the AutoML Tables documentation. Could you verify that you followed the right doc?

Thanks,
Helin



Dylan Finlayson

unread,
Aug 11, 2021, 5:31:10 PM8/11/21
to cloud-automl-tables-discuss
Solved. I was using the AutoML Tables docker container, rather than the Vertex AutoML Tabular, as Helin correctly guessed above.

Thanks so much.

Reply all
Reply to author
Forward
0 new messages