srihari-humbarwadi / DeepLabV3_Plus-Tensorflow2.0

DeepLabV3+ implemented in TensorFlow2.0
https://arxiv.org/pdf/1802.02611.pdf
168 stars 45 forks source link

How can I solve ValueError: No such layer: conv #29

Open sdfjkj opened 2 years ago

sdfjkj commented 2 years ago

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()
srihari-humbarwadi commented 2 years ago

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?