Hi ! I am trying to use tfgo to compute embeddings using universal sentence encoder but facing some error. Not sure if there is some issue in the go code or something else. It seems that the model is loaded successfully. Any help is appreciated
model loaded successfully
2022-02-25 17:36:56.393949: W tensorflow/core/framework/op_kernel.cc:1745] OP_REQUIRES failed at lookup_table_op.cc:929 : FAILED_PRECONDITION: Table not initialized.
panic: {{function_node __inference_pruned_6740}} {{function_node __inference_pruned_6740}} Table not initialized.
[[{{node text_preprocessor/hash_table_Lookup/hash_table_Lookup/LookupTableFindV2}}]]
[[StatefulPartitionedCall/StatefulPartitionedCall]]
goroutine 1 [running]:
github.com/galeone/tfgo.(*Model).Exec(0xc00019c030, 0xc00023fe58, 0x1, 0x1, 0xc00023fe78, 0x0, 0x0, 0x0)
/Users/pratyushgoel/go/pkg/mod/github.com/galeone/tfgo@v0.0.0-20210914072119-caabdf830ee3/model.go:73 +0xd7
main.main()
/Users/pratyushgoel/workspace/experiments/tfgo-example/main.go:14 +0x2e5
Process finished with the exit code 2
On running the command saved_model_cli show --all --dir universal-sentence-encoder_3/ I get the results
MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:
signature_def['__saved_model_init_op']:
The given SavedModel SignatureDef contains the following input(s):
The given SavedModel SignatureDef contains the following output(s):
outputs['__saved_model_init_op'] tensor_info:
dtype: DT_INVALID
shape: unknown_rank
name: NoOp
Method name is:
signature_def['serving_default']:
The given SavedModel SignatureDef contains the following input(s):
inputs['inputs'] tensor_info:
dtype: DT_STRING
shape: (-1)
name: serving_default_inputs:0
The given SavedModel SignatureDef contains the following output(s):
outputs['outputs'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 512)
name: StatefulPartitionedCall:0
Method name is: tensorflow/serving/predict
Concrete Functions:
Function Name: '__call__'
Option #1
Callable with:
Argument #1
inputs: TensorSpec(shape=<unknown>, dtype=tf.string, name='inputs')
Function Name: 'init_op'
Function Name: 'predict'
Option #1
Callable with:
Argument #1
inputs
Hi ! I am trying to use tfgo to compute embeddings using universal sentence encoder but facing some error. Not sure if there is some issue in the go code or something else. It seems that the model is loaded successfully. Any help is appreciated
I have downloaded the USE from https://tfhub.dev/google/universal-sentence-encoder/3
Error i am getting is:
On running the command
saved_model_cli show --all --dir universal-sentence-encoder_3/
I get the resultsGO file looks like this: