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)