我是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