1.代碼 https://github.com/jacobgil/keras-dcgan/blob/master/dcgan.py
def generator_containing_discriminator(g, d):
model = Sequential()
model.add(g)
d.trainable = False
model.add(d)
return model
問題:ValueError: Variable batch_normalization_1/moving_mean/biased already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
解決方法:https://github.com/keras-team/keras/issues/9235
Which version of tensorflow are you using? We have noticed a problem with version 1.3 with keras 2.1.3. If you are using version 1.3, can you upgrade the tensorflow version and try running the model again?
升級:pip install --upgrade tensorflow==1.4 後解決
tip!!!! 該github代碼建議在tensorflow 1.5 keras 2.1.4環境下運行 親測1.4和2.1。3搭配報錯