srihari-humbarwadi/DeepLabV3_Plus-Tensorflow2.0

How can I solve ValueError: No such layer: conv

sdfjkj opened this issue · 1 comments

I'm trying Dog Memorizer GAN from kaggle (https://www.kaggle.com/cdeotte/dog-memorizer-gan/notebook#Build-Generator-and-GAN) but I cant find the problem. How can I solve this error


ValueError Traceback (most recent call last)
in
7 # COMPILE GAN
8 gan = Model(gan_input, gan_output)
----> 9 gan.get_layer('model_1').get_layer('conv').set_weights([np.array([[[[-1 ]]],[[[255.]]]])])
10 gan.compile(optimizer=Adam(5), loss='mean_squared_error')
11

~\anaconda3\lib\site-packages\tensorflow\python\keras\engine\network.py in get_layer(self, name, index)
561 if layer.name == name:
562 return layer
--> 563 raise ValueError('No such layer: ' + name)
564
565 @Property

ValueError: No such layer: conv

This is the code>>>

BUILD GENERATIVE ADVERSARIAL NETWORK

discriminator.trainable=False
gan_input = Input(shape=(10000,))
x = generator(gan_input)
gan_output = discriminator(x)

COMPILE GAN

gan = Model(gan_input, gan_output)
gan.get_layer('model_1').get_layer('conv').set_weights([np.array([[[[-1 ]]],[[[255.]]]])])
gan.compile(optimizer=Adam(5), loss='mean_squared_error')

DISPLAY ARCHITECTURE

gan.summary()

Can you please explain how this repository is related to the issue? Do you see a similar error while running the code in this repository?