我是Tensorflow的新手。我有兩個張量/張量流對象,X & Y基本上是兩個矩陣。我對它們執行一些計算並希望打印它們的值。TensorFlow - 無法獲取變量的值
output = tf.reduce_sum(tf.log(tf.exp(tf.matmul(tf.transpose(X), Y))))
print(output.get_shape()) #Shows()
我想要得到output
的值。我無法打印它。
試着這樣做:
init = tf.initialize_all_variables()
sess = tf.Session()
output = tf.reduce_sum(tf.log(tf.exp(tf.matmul(tf.transpose(X), Y))))
print(output.get_shape())
sess.run(init)
v = sess.run(output)
print(v)
,但無濟於事!引發以下錯誤:
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder' with dtype int32 and shape [100]
我只需3小時前[這裏](http://stackoverflow.com/questions/42471921/executing-function-in解釋此過程-tensorflow/42472053?noredirect = 1#comment72085226_42472053) – RuDevel