Tensorflow: Unable to feed a string through to placeholder tensor
Tensorflow: Unable to feed a string through to placeholder tensor I'm writing a function to compare the similarity of two strings, using Google's universal sentence encoder. Following the instructions in the notebook provided here I have the following method in my class that takes two sentences as input and prints the similarity between them. def tf_sim(self, text1, text2): # Reduce logging output. tf.logging.set_verbosity(tf.logging.ERROR) sim_input1 = tf.placeholder(tf.string, shape=(None), name="sim_input1") sim_input2 = tf.placeholder(tf.string, shape=(None), name="sim_input2") embedding1 = self.embed([sim_input1]) embedding2 = self.embed([sim_input2]) encode1 = tf.nn.l2_normalize(embedding1, axis=1) encode2 = tf.nn.l2_normalize(embedding2, axis=1) sim_scores = -tf.acos(tf.reduce_sum(tf.multiply(encode1, encode2), axis=1)) init_vars = tf.global_variables_initializer() init_tables = tf.tables_initializer() w...
