title: Output tensors to a Model must be the output of a TensorFlow `Layer` (thus holding past layer metadata) in Model Api Tensorfow
body: <pre><code>def generator_model(self):
  
          input_images = Input(shape=[64,64,1])
          layer1= Conv2D(self.filter_size,self.kernel_size,(2,2),padding='same',use_bias=False,kernel_initializer='random_uniform')(input_images)
          layer1=LeakyReLU(0.2)(layer1)
  
          layer2= Conv2D(self.filter_size*2,self.kernel_size,(2,2),padding='same',use_bias=False,kernel_initializer='random_uniform')(layer1)
          layer2=BatchNormalization()(layer2)
          layer2=LeakyReLU(0.2)(layer2)
  
          layer3=Conv2D(self.filter_size*4,self.kernel_size,(2,2),padding='same',use_bias=False,kernel_initializer='random_uniform')(layer2)
          layer3=BatchNormalization()(layer3)
          layer3=LeakyReLU(0.2)(layer3) 
  
          layer4=Conv2D(self.filter_size*8,self.kernel_size,(2,2),padding='same',use_bias=False,kernel_initializer='random_uniform')(layer3)
          layer4=BatchNormalization()(layer4)
          layer4=LeakyReLU(0.2)(layer4)  
  
          layer5=Conv2D(self.filter_size*16,self.kernel_size,(2,2),padding='same',use_bias=False,kernel_initializer='random_uniform')(layer4)
          layer5=BatchNormalization()(layer5)
          layer5=LeakyReLU(0.2)(layer5)            
  
          up_layer5 = Conv2DTranspose(self.filter_size*8,self.kernel_size,strides = (2,2),padding='same',use_bias=False)(layer5)
          up_layer5=BatchNormalization()(up_layer5)
          up_layer5=LeakyReLU(0.2)(up_layer5)
          #shape = 4*4*512
          up_layer5_concat = tf.concat([up_layer5,layer4],0)
  
          up_layer6 = Conv2DTranspose(self.filter_size*4,self.kernel_size,strides = (2,2),padding='same',use_bias=False)(up_layer5_concat)
          up_layer6 =BatchNormalization()(up_layer6)
          up_layer6 =LeakyReLU(0.2)(up_layer6)
                      up_layer_6_concat = tf.concat([up_layer6,layer3],0)
  
          up_layer7 = Conv2DTranspose(self.filter_size*2,self.kernel_size,strides = (2,2),padding='same',use_bias=False)(up_layer_6_concat)
          up_layer7 =BatchNormalization()(up_layer7)
          up_layer7 =LeakyReLU(0.2)(up_layer7)
          up_layer_7_concat = tf.concat([up_layer7,layer2],0)
  
          up_layer8 = Conv2DTranspose(self.filter_size,self.kernel_size,strides = (2,2),padding='same',use_bias=False)(up_layer_7_concat)
          up_layer8 =BatchNormalization()(up_layer8)
          up_layer8 =LeakyReLU(0.2)(up_layer8)
          up_layer_8_concat = tf.concat([up_layer8,layer1],0)    
          output = Conv2D(3,self.kernel_size,strides = (1,1),padding='same',use_bias=False)(up_layer_8_concat)
          final_output = LeakyReLU(0.2)(output)
  
          model = Model(input_images,output)
          model.summary()
          return model
  </code></pre>
  
  <p>This is how my generator_model looks like, and I have followed a research paper to make the architecture. But, I am in problem with the error. I have checked the other solutions to given problem here in SO, but none of them worked for me as they are little bit different maybe. My guess, the problem is there with the <code>tf.concat()</code> function which should be put as tensorflow keras layer of Lambda, but I tried that too and of no help. Any help regarding this issue? Bugging me for 2 days now. </p>