How to use exported automl tensorflow model for tabular data in Python
@kaywolter,
Exporting AutoML tabular models has the following limitations:

- You can export AutoML tabular classification and regression models only. Exporting AutoML tabular forecasting models is not supported.

- Vertex Explainable AI is not available using exported tabular models. If you need to use Vertex Explainable AI, you must serve predictions from a model hosted by Vertex AI.

- The exported tabular model can run only on x86 architecture CPUs that support Advanced Vector Extensions (AVX) instruction sets.

And tabular data to string tensors, we can follow the below process.

```
import numpy as np
def my_func(arg):
  arg = tf.convert_to_tensor(arg, dtype=tf.float32)
  return arg
# The following calls are equivalent.

value_1 = my_func(tf.constant([[1.0, 2.0], [3.0, 4.0]]))
print(value_1)



value_2 = my_func([[1.0, 2.0], [3.0, 4.0]])
print(value_2)



value_3 = my_func(np.array([[1.0, 2.0], [3.0, 4.0]], dtype=np.float32))
print(value_3)
```


Also please take a look at this official doc [link](https://cloud.google.com/vertex-ai/docs/tabular-data/bp-tabular) for the reference. Thank you! Hi tilakrayal,

Thanks for the response. Not sure if understood your code correctly. When I pass the value returned from my_func I get error `input #0(zero-based) was expected to be a string tensor but is a float tensor`.

How can I pass the array to the model's signature?

Kay @kaywolter,
The code provided above was the sample toy code reference for converting tabular data to string tensors and also
can export AutoML tabular classification and regression models only. Exporting AutoML tabular forecasting models is not supported. Vertex Explainable AI is not available using exported tabular models. If you need to use Vertex Explainable AI, you must serve predictions from a model hosted by Vertex AI. Thank you! Closing this as stale. Please reopen if this is still a valid request. Thank you! Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59637">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59637">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Support

### Have you reproduced the bug with TF nightly?

No

### Source

binary

### Tensorflow Version

2.9

### Custom Code

Yes

### OS Platform and Distribution

Linux Ubuntu

### Mobile device

_No response_

### Python version

3.7

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

```shell
Hello,

I followed the instructions from Google Cloud to export and load a trainen AutoML model (training was done with data from BigQuery): https://cloud.google.com/vertex-ai/docs/export/export-model-tabular

As we want to integrate this model in our Spark flow I need to load it and make predictions on it in Python directly. I tested the model with the tensorflow serving docker image as described in the documentation. This works perfectly fine. However, when I try to use the model directly I get an erro "Error: DATA_LOSS: Failed skipping unrequested field". Input must be a string tensor. I tried several formats (JSON, CSV) but none of them seemed to be correct.

Can anybody give me a hint on how to convert the tabular data into a string tensor in a way that the model accepts the data and returns a prediction?

Thanks in advance!!
Kay
```


### Standalone code to reproduce the issue

```shell
import struct2tensor
import tensorflow as tf
import json
import requests


MODEL_PATH = '/home/kay/tmp/models/ml_cr_2022_12'

predict_sample = {'Animals': '0.0', 'Apparel': '0.0165423884627339', 'Arts': '0.000893240417492657', 'Baby': '0.0', 'Business': '0.0', 'Cameras': '0.000158694043359865', 'Electronics': '0.0', 'Food': '6.4749054130615e-05', 'Furniture': '0.0', 'Hardware': '0.000247099237409669', 'Health': '0.00928790329794604', 'Home': '0.0442892335578687', 'Luggage': '3.65980448833796e-05', 'Mature': '0.0', 'Media': '0.70324946112978', 'Office': '0.000297127488105344', 'Religious': '0.0', 'Software': '0.0', 'Sporting': '0.0', 'Toys': '0.0', 'Vehicles': '7.25524348202571e-06', 'aov_bench': '59.8599307847218', 'aov_rep': '0', 'avgprice': '12.704623853211', 'bouncerate': '81.06', 'brand_search_volume': '0', 'brand_search_volume_share': '0.0', 'category': 'adult', 'competition': '0.0', 'cpc': '0.0', 'cr_bench': '0.00972125074728272', 'date': '2022-08-01', 'directShare': '40.79', 'displayShare': '0.0', 'domain_cat_1': '0', 'domain_cat_2': '0', 'domain_search_volum_share': '0.0', 'domain_search_volume': '0', 'ekps_aov': '26.859908543707', 'ekps_cr': '0.0194748958674429', 'iib_bench': '1.04867824234893', 'int64_field_0': '1', 'lineid': '1', 'mailShare': '0.0', 'mainCountry': 'Germany', 'mainCountryShare': '84.25', 'no_cat': '0.224926250022808', 'organicShare': '57.66', 'pageviews': '1.74154466250536', 'paidsearchShare': '0.0'}

# Request to tensorflow_serving docker container, works perfectly
response = requests.post(
    'http://localhost:8080/predict',
    json={'instances': [predict_sample]}
)
# prints {"predictions": 0.0056517720222473145}
print(response.text)

model = tf.saved_model.load(MODEL_PATH)
infer = model.signatures["serving_default"]

# No matter what I tried as input here, I always get error "Error consuming . Error: DATA_LOSS: Failed skipping unrequested field"
print(infer(tf.constant('How to feed model with one string tensor??')))
```


### Relevant log output

_No response_</details>