版本 bug

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搭配报错

猜你喜欢

转载自blog.csdn.net/huowa9077/article/details/79344484