如果"我的朋友"犯了在RStudio中输入以下代码的愚蠢错误,我将如何(我的意思是,他!)突破循环(不重新启动R)?
while (TRUE) readline()
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 tf.keras 中使用合并层,但得到AssertionError: Could not compute output Tensor("concatenate_3/Identity:0", shape=(None, 10, 8), dtype=float32). 最小(非)工作示例:
import tensorflow as tf
import numpy as np
context_length = 10
input_a = tf.keras.layers.Input((context_length, 4))
input_b = tf.keras.layers.Input((context_length, 4))
#output = tf.keras.layers.concatenate([input_a, input_b]) # same error
output = tf.keras.layers.Concatenate()([input_a, input_b])
model = tf.keras.Model(inputs = (input_a, input_b), outputs = output)
a = np.random.rand(3, context_length, 4).astype(np.float32)
b = np.random.rand(3, context_length, 4).astype(np.float32)
pred = model(a, b)
Run Code Online (Sandbox Code Playgroud)
我在其他合并层(例如add)中遇到相同的错误。我在 TF2.0.0-alpha0 上,但在 colab 上与 2.0.0-beta1 相同。