您如何将两个输入放入tensorflow lambda层?我已经尝试过:
channel_input=Input(shape=(4,),dtype='complex64',name='channel_input')
...
realed_ffted_channel1 = Dense(2*N_c,activation='relu')(realed_ffted_channel)
precoded_data = Lambda(lambda x,y: tf.concat([x,y],1))([encoding_x,realed_ffted_channel1])
但是,我收到此错误
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-29-9332eac3e7cf> in <module>()
10
11 #Precoding Encoder
---> 12 precoded_data = Lambda(lambda x,y: tf.concat([x,y],1))([encoding_x,realed_ffted_channel1])
13 encoder_data = Dense(3*N_c,activation='relu')(precoded_data)
14 encoder_data1 = Dense(N_c,activation='relu')(encoder_data)
1 frames
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/layers/core.py in call(self, inputs, mask, training)
820 arguments['training'] = training
821 with variable_scope.variable_creator_scope(self._variable_creator):
--> 822 return self.function(inputs, **arguments)
823
824 def _variable_creator(self, next_creator, **kwargs):
TypeError: <lambda>() missing 1 required positional argument: 'y'
表示未传递第二个输入y
。
您可以这样做: