1

Can you help me with this error?

TypeError: The added layer must be an instance of class Layer. Found: <keras.layers.convolutional.Conv2DTranspose object at 0x7f5dc629f240>

I get this when I try to execute the following line

    decoder.add(Deconvolution2D(64, 3, 3, subsample=(1, 1), border_mode='same'))

My imports are:

from keras.layers import Layer
from keras.layers import Input
from keras.layers.convolutional import Deconvolution2D
cakeBoy
  • 27
  • 5

1 Answers1

0

According to Installing Keras: To use Keras, we will need to have the TensorFlow package installed. Once TensorFlow is installed.

Now import Keras as shown below

from tensorflow import keras

Now Deconvolution2Dlayer has been renamed Conv2DTranspose layer.

Now you can import layers as shown below

from tensorflow.keras.layers import Input, Conv2DTranspose

For more information you can refer here