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

9.2 원하는 숫자 생성하기 코드에서 ValueError 납니다.... #41

Open
ghost opened this issue Dec 29, 2018 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Dec 29, 2018

G = generator(Z, Y) 부분에서

ValueError: Variable generator/dense/kernel already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:
이런 에러가 나오는데 해결방법 알려주시면 감사하겠습니다.....ㅠㅠ

@ufxpri
Copy link

ufxpri commented Jan 3, 2019

혹시 수정하신 코드가 있으신가요?

보통 reuse 가 포함된 에러가 나는 이유는 같은 이름 또는 객체의 레이어(신경망) 이 중복 선언되었을때 나타납니다.

예를들어

model = tf.layers.dense( model, 16, name="dense1" )
model = tf.layers.dense( model, 32, name="dense1" )

처럼 이름이 같다거나

def dense_layer(model):
    return tf.layers.dense( model, 16, name="dense1" )

model = dense_layer(model)
model = dense_layer(model)

처럼 이름이 있는 레이어를 중복선언했을때 나타납니다.

혹시 ipynb 로 옮겨서 실행하셨다면 모든셀을 초기화후 순서대로 다시 시도해보시길 바랍니다.

tf.variable_scope('generator')

또한 마찬가지입니다.

@ThereIsNoWindBag
Copy link

ThereIsNoWindBag commented Feb 18, 2020

import 문들 다음, 본 코드 시작하는 사이 부분에

tf.reset_default_graph( ) 문 추가하시면 됩니다.

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