How to cast the Average layer output to push it into a Conv2D layer in Keras?

I am trying to build a custom CNN using keras functional API. The issue with my theoretical idea and pratical one is that when I try to Average the ouput of three Conv2D layers and pass it to another Conv2D. I get an error saying that the output of Average is tf.float meanwhile Conv2D (that is the first convolution layer of VGG16, because I am doing transfer learning) expects to get a tf.int32

I am getting the follwing error: **TypeError: Expected int32, got 0.0 of type 'float' instead.

Notes:

  1. I have tried Maximum and Minimum as a test only and still getting the same error.
  2. Unfortunetly I can't share the code because of NDA.

Here's a code snippet:

self._layer_hs_o = Average(name="heads")(
      [self._layer_hs_s, self._layer_hs_m, self._layer_hs_l])
# Trying to pass the average output to the following Conv2D layer
self._layer_d2c_c = Conv2D(d2c_config["filters"], 
      d2c_config["kernels"][0], 
      padding="same",
      activation=d2c_config["activation"], 
      name="d2c_c",
      kernel_initializer=d2c_config["init"],
      input_shape=self._layer_hs_o.shape,
      dilation_rate=d2c_config["dilations"][0]
    )(self._layer_hs_o)

At this moment the model can't be compiled because of this step. When I skip it to normal convolutions only it get compiled and the learning happens normally. Yet I need to use the Average layer at some extent.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum