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

ValueError: All layers added to a Sequential model should have unique names. #19

Open
Chanarin opened this issue Apr 3, 2023 · 1 comment

Comments

@Chanarin
Copy link

Chanarin commented Apr 3, 2023

Please help. I used tensorflow 2.10.1
Traceback (most recent call last):
File "D:\stargan-v2-tensorflow\main.py", line 117, in
main()
File "D:\stargan-v2-tensorflow\main.py", line 103, in main
gan.build_model()
File "D:\stargan-v2-tensorflow\StarGAN_v2.py", line 146, in build_model
self.style_encoder = StyleEncoder(self.img_size, self.style_dim, self.num_domains, max_conv_dim=self.hidden_dim, sn=False, name='StyleEncoder')
File "D:\stargan-v2-tensorflow\networks.py", line 141, in init
self.shared_layers, self.unshared_layers = self.architecture_init()
File "D:\stargan-v2-tensorflow\networks.py", line 161, in architecture_init
shared_layers = Sequential(blocks)
File "C:\Users\user\anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\trackable\base.py", line 205, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:\Users\user\anaconda3\envs\tf-gpu\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\user\anaconda3\envs\tf-gpu\lib\site-packages\keras\engine\sequential.py", line 190, in add
raise ValueError(
ValueError: All layers added to a Sequential model should have unique names. Name "leaky_relu" is already the name of a layer in this model. Update the name argument to
pass a unique name.

@sr1dh4r
Copy link

sr1dh4r commented Aug 1, 2023

you can use the same logic mentioned here .. I guess its related to the tensorflow version being different
#3 (comment)

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