我有两个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
。
这种做法是否正确?
答案 0 :(得分:0)
我收到以下错误消息
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).
我想尝试做像
这样的事情lay1_valid = tf.nn.relu( data_entries_times_weights1 + biases)
其中:
很可能 data_entries_times_weights1 等于输入。仔细检查data_entries_times_weights1是
data_entries_times_weights1 = tf.matmul( input , weights )