-1
我有两个tf.Variable
:如何偏见添加到神经网络层
data_entries_times_weights1
biases1
他们有形状:
(10000, 1024)
(1024,)
然而,当我乘他们是这样的:
lay1_valid = tf.nn.relu(data_entries_times_weights1 + biases1)
我收到:
ValueError: Tensor("Variable:0", shape=(784, 1024), dtype=float32_ref) must be from the same graph as Tensor("Const:0", shape=(10000, 784), dtype=float32).
从我在Github上看到的,人们都以类似的方式添加偏见,如:data_entries_times_weights1 + biases1
。
这种方法是否正确?
这是正确的。问题在于'data_entries_times_weights1'在图形中定义,而'biases1'在另一个图形中定义 – nessuno
您可以显示整个代码吗? – nessuno
重复https://stackoverflow.com/questions/44757650/multiplying-two-tensors –