I have a model for an AutoEncoder
as follows:
height, width = 28, 28
input_img = Input(shape=(height * width,))
encoding_dim = height * width//256
x = Dense(height * width, activation='relu')(input_img)
encoded1 = Dense(height * width//2, activation='relu')(x)
encoded2 = Dense(height * width//8, activation='relu')(encoded1)
y = Dense(encoding_dim, activation='relu')(encoded2)
decoded2 = Dense(height * width//8, activation='relu')(y)
decoded1 = Dense(height * width//2, activation='relu')(decoded2)
z = Dense(height * width, activation='sigmoid')(decoded1)
autoencoder = Model(input_img, z)
#encoder is the model of the autoencoder slice in the middle
encoder = Model(input_img, y)
decoder = Model(y, z)
print(encoder)
print(decoder)
The encoder part is retrived using the code above, however I can't get the decoder part using the code I added above:
I recieve the following error:
ValueError: Graph disconnected: cannot obtain value for tensor Tensor("input_39:0", shape=(?, 784), dtype=float32) at layer "input_39". The following previous layers were accessed without issue: []
Could you please guide me how to get that part?