DeepLabV3_Plus-Tensorflow2.0 icon indicating copy to clipboard operation
DeepLabV3_Plus-Tensorflow2.0 copied to clipboard

How can I solve ValueError: No such layer: conv

Open sdfjkj opened this issue 2 years ago • 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()

sdfjkj avatar Dec 08 '21 17:12 sdfjkj

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?

srihari-humbarwadi avatar Dec 09 '21 07:12 srihari-humbarwadi