In the happyModel() function while adding the layers in the sequential model, all the layers are added successfully but only the Dense layer gives the following error:
TypeError: The added layer must be an instance of class Layer. Found: tf.Tensor(
This is my code line for Dense layer:
tfl.Dense(1, activation = ‘sigmoid’)
Worked for me too the dense part isok too. Got a Warning:
WARNING:tensorflow:Layer conv2d is casting an input tensor from dtype float64 to the layer’s dtype of float32, which is new behavior in TensorFlow 2. The layer has dtype float32 because its dtype defaults to floatx.
If you intended to run this layer in float32, you can safely ignore this warning. If in doubt, this warning is likely only an issue if you are porting a TensorFlow 1.X model to TensorFlow 2.
To change all layers to have dtype float64 by default, call tf.keras.backend.set_floatx('float64'). To change just this layer, pass dtype=‘float64’ to the layer constructor. If you are the author of this layer, you can disable autocasting by passing autocast=False to the base Layer constructor.