张量流。张量(“Mul:0”,shape =(),dtype = int32)

时间:2017-10-03 15:33:49

标签: python tensorflow

我有以下python文件,当我运行它时,它显示错误,我该如何解决呢?

var params = false
var baseUrl = ''
var currUrl = window.location.href

if (window.location.search != '') {
  params = true
}

if (params) {
  baseUrl = currUrl + window.location.search
  window.location.href = baseUrl
}

1 个答案:

答案 0 :(得分:1)

到目前为止,您所做的是创建一个(非常简单的)计算图。为了实际进行任何计算,您需要会话并使用运行方法。

我强烈建议您阅读https://www.tensorflow.org/get_started/get_started以了解张量流的计算模型。

import tensorflow as tf
x1 = tf.constant(5)
x2 = tf.constant(6)
result = tf.multiply(x1,x2)
sess = tf.Session()
sess.run(result)

[编辑]我还应该补充一点,你看到的输出根本不是错误,它只是你创建的张量的字符串表示。