Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sdfjkj opened this issue Dec 8, 2021 · 1 comment
Open

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

sdfjkj opened this issue Dec 8, 2021 · 1 comment

Comments

@sdfjkj
Copy link

sdfjkj commented Dec 8, 2021

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 sdfjkj changed the title ValueError: No such layer: conv How can I solve ValueError: No such layer: conv Dec 8, 2021
@srihari-humbarwadi
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants