tensorflow在老版本中tf.concat的参数设置为
tf.concat(concat_dim, values, name = 'concat')
而在新版本(1.3.0)后换为了
tf.concat(values, concat_dim, name = 'concat')
所以只需将前两维的位置换下,也许就不会报错了。
例如,将原来的
x1 = tf.Variable(tf.random_normal([3, 3, 3]))
y1 = tf.Variable(tf.random_normal([3, 3, 3]))
z1 = tf.concat(0, [x1, y1])
换为
x1 = tf.Variable(tf.random_normal([3, 3, 3]))
y1 = tf.Variable(tf.random_normal([3, 3, 3]))
z1 = tf.concat([x1, y1], 0)