我需要卷积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]