I am trying some examples for Universal sentence encoder the code below:
sentences_list = [
# phone related
'My phone is slow',
'My phone is not good',
'I need to change my phone. It does not work well',
'How is your phone?',
# age related
'What is your age?',
'How old are you?',
'I am 10 years old',
# weather related
'It is raining today',
'Would it be sunny tomorrow?',
'The summers are here.'
]
with tf.Session() as session:
session.run([tf.global_variables_initializer(),
tf.tables_initializer()])
sentences_embeddings = session.run(embed.signatures['default'] (sentences_list))
But get the error:
ValueError: All inputs to
ConcreteFunction
s must be Tensors; on invocation of pruned, the 0-th input (['My phone is slow', 'My phone is not good', 'I need to change my phone. It does not work well', 'How is your phone?', 'What is your age?', 'How old are you?', 'I am 10 years old', 'It is raining today', 'Would it be sunny tomorrow?', 'The summers are here.']) was not a Tensor.