在模型中包含2个张量 - Keras

时间:2017-12-28 14:15:24

标签: tensorflow computer-vision deep-learning keras

我需要卷积2个张量,然后将卷积应用于输出。 我正在使用lambda层,但我无法完成这项工作。

def corr(input):
a = input[0]
b = input[1]
x = tf.nn.convolution(a, b, padding='SAME')
return x

# Apply on im1
filtered_im1 = conv1(i1)
filtered_im1 = conv2(filtered_im1)
filtered_im1 = pool(filtered_im1)
drop_filtered_im1 = drop(filtered_im1)
filtered_im1 = conv3(drop_filtered_im1)
filtered_im1 = conv4(filtered_im1)
filtered_im1 = pool2(filtered_im1)
im = drop2(filtered_im1)

# Concatenate Im with flow
imflow  = Lambda(corr)([im, conv_f2]

0 个答案:

没有答案