从形状7与其他形状合并。对于具有输入形状的'AddN'(op:'AddN'):[],[],[],[],[],[],[],[],[?]

时间:2018-06-06 03:28:50

标签: tensorflow

def weight_variable(shape,o):
    initial = tf.truncated_normal(shape,stddev=0.1)
    u = tf.Variable(initial)
    tf.add_to_collection("losses", tf.contrib.layers.l2_regularizer(o)(u))
    return u
def bias_variable(shape,o):
    initial = tf.constant(0.1,shape=shape)
    v = tf.Variable(initial)
    tf.add_to_collection("losses", tf.contrib.layers.l2_regularizer(o)(v))
    return v

tf.add_to_collection("losses",cross_entropy)
loss = tf.add_n(tf.get_collection("losses"))
train_step = tf.train.AdamOptimizer(1e-4).minimize(loss)

这会发生错误以及add_n()形状错误的原因

0 个答案:

没有答案