Hi everyone,
I am struggling to import the Google Universal Sentence Encoder (Multilingual) model into Vertica 25.4.1 using the TensorFlow integration.
My Environment:
-
OS: Rocky Linux 9
-
Vertica Version: 25.4.1-x
-
TensorFlow: 2.15.0
-
TensorFlow Text: 2.15.0 (required for the multilingual USE ops)
-
Python: 3.10 (for model freezing)
The Issue: I have successfully loaded the USE model in Python, registered the SentencepieceOp via tensorflow_text, and exported it as a frozen .pb file with a corresponding tf_model_desc.json.
However, when I run the following SQL command in Vertica:
SELECT IMPORT_MODELS('/home/dbadmin/frozen_dir/' USING PARAMETERS category='TENSORFLOW');
I consistently get this error: ERROR 9450: Failed to import model(s): Failed to import single model: Error in importModelFiles: Error calling setup() in User Function import_model_files at [src/Common/TFCommon.cpp:51], error code: 0, message: Unsupported tensorflow type: 0
My tf_model_desc.json:
{
"frozen_graph": "use_model.pb",
"input_desc": [{
"name": "input_text",
"dims": [-1],
"data_type": "string"
}],
"output_desc": [{
"name": "Identity",
"dims": [-1, 512],
"data_type": "float"
}]
}
What I've tried:
-
Verified that the tensor name
input_textexists in the frozen graph. -
Attempted changing
data_typein the JSON to"STRING","string", and tried changingdimsfrom[-1]to[1]. -
Confirmed that
tensorflow_textops are required for this model.
The error type: 0 seems to map to DT_INVALID in the TensorFlow source. Does Vertica's TensorFlow integration support DT_STRING tensors for the Multilingual USE model? Or is there a specific way to define string inputs in the descriptor file for this version of Vertica?
Any guidance or workarounds would be greatly appreciated!