1
当我宣布这样我的变量:Tensorflow形状必须是1级,但是等级2
x = tf.Variable([len(_ELEMENT_LIST), 4], dtype=tf.float32)
我收到以下错误:
E0622 20:04:25.241938 21886 app.py:544] Top-level exception: Shape must be rank 1 but is rank 2 for 'input_layer/concat' (op: 'ConcatV2') with input shapes: [5], [5,1], [5,1], [].
E0622 20:04:25.252672 21886 app.py:545] Traceback (most recent call last):
当我这样做是这样的:
x = tf.get_variable("x", [len(_ELEMENT_LIST), 4])
它的工作原理
我试图用concat来计算张量。
tf.concat([
x, features["y"],
features["z"]
], 1)