jacobgil / keras-dcgan

Keras implementation of Deep Convolutional Generative Adversarial Networks
973 stars 413 forks source link

ValueError: Variable batch_normalization_1/moving_mean/biased already exists #25

Open koshyviv opened 6 years ago

koshyviv commented 6 years ago

I am using tensorflow backend and updated the keras.json file as -

{
    "floatx": "float32",
    "epsilon": 1e-07,
    "backend": "tensorflow",
    "image_data_format": "channels_last"
    "image_dim_ordering": "th"
}

This is the error that i am getting -

Using TensorFlow backend.
test2.py:31: UserWarning: Update your `Dense` call to the Keras 2 API: `Dense(input_dim=100, units=1024)`
  model.add(Dense(input_dim=100, output_dim=1024))
Traceback (most recent call last):
  File "test2.py", line 177, in <module>
    train(BATCH_SIZE=args.batch_size)
  File "test2.py", line 102, in train
    d_on_g = generator_containing_discriminator(g, d)
  File "test2.py", line 71, in generator_containing_discriminator
    model.add(g)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\models.py", line 467, in add
    layer(x)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\topology.py", line 619, in __call__
    output = self.call(inputs, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\models.py", line 549, in call
    return self.model.call(inputs, mask)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2085, in call
    output_tensors, _, _ = self.run_internal_graph(inputs, masks)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2236, in run_internal_graph
    output_tensors = _to_list(layer.call(computed_tensor, **kwargs))
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\layers\normalization.py", line 193, in call
    self.momentum),
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 1004, in moving_average_up
date
    x, value, momentum, zero_debias=True)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\moving_averages.py", line 70, in assign_mo
ving_average
    update_delta = _zero_debias(variable, value, decay)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\moving_averages.py", line 180, in _zero_de
bias
    "biased", initializer=biased_initializer, trainable=False)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1065, in get_variable
    use_resource=use_resource, custom_getter=custom_getter)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 962, in get_variable
    use_resource=use_resource, custom_getter=custom_getter)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 367, in get_variable
    validate_shape=validate_shape, use_resource=use_resource)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 352, in _true_getter
    use_resource=use_resource)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 664, in _get_single_va
riable
    name, "".join(traceback.format_list(tb))))
ValueError: Variable batch_normalization_1/moving_mean/biased already exists, disallowed. Did you mean to set reuse=True
 in VarScope? Originally defined at:

  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2630, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op

    op_def=op_def)

Any idea what i might be doing wrong?

zerojuzi commented 6 years ago

@koshyviv pip install --upgrade tensorflow==1.4