Giter Club home page Giter Club logo

gan's Issues

A small question

Why does the first param of the functions from line 28 to line 30 in nets.py is z rather than g?

After training , cannot test the cgan if i define a variable and use cgan.generate(example) always wrong

Variable G_conv_mnist/fully_connected/weights already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "C:\Users\tc\Anaconda3\envs\keras-gpu\lib\site-packages\tensorflow\python\framework\ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
File "C:\Users\tc\Anaconda3\envs\keras-gpu\lib\site-packages\tensorflow\python\framework\ops.py", line 3392, in create_op
op_def=op_def)
File "C:\Users\tc\Anaconda3\envs\keras-gpu\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)

关于GAN 的训练

如果GAN训练收敛了, 之后固定G,再接着训练D,那么D还可以判断出来是否是G生成的图片吗?

encounter ValueError when I "python dcgan.py"

ValueError: Variable G_conv/Conv/weights does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

I wonder if I am the only one who meet this problem and I have been confused for days. I hope I can get some help.

here is the information
Traceback (most recent call last):
File "dcgan.py", line 107, in
dcgan = DCGAN(generator, discriminator, data)
File "dcgan.py", line 34, in init
self.D_real, _ = self.discriminator(self.X)
File "/home/baiqiujian/github/GAN-master/nets.py", line 146, in call
stride=2, activation_fn=lrelu)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 947, in convolution
outputs = layer.apply(inputs)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 492, in apply
return self.call(inputs, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 434, in call
self.build(input_shapes[0])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/convolutional.py", line 137, in build
dtype=self.dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 374, in add_variable
trainable=trainable and self.trainable)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 360, in get_variable
validate_shape=validate_shape, use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1370, in layer_variable_getter
return _model_variable_getter(getter, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1362, in _model_variable_getter
custom_getter=getter, use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/variables.py", line 261, in model_variable
use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/variables.py", line 216, in variable
use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter
use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 682, in _get_single_variable
"VarScope?" % name)
ValueError: Variable G_conv/Conv/weights does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

Some puzzles about the hidden variable C

Thank you for writing such an excellent and convenient code!But I don't understand the meaning of C in the paper.How should c be valued for different problems? Why can C be continuous or discrete?
Looking forward to your answer~

wgan_conv runs error

The code in the file's wgan_conv has little error:
the class G_conv generate [-1, 32, 32, 1] shape of inputs,
but class D_conv's input is [-1, 28, 28, 1],the dimension not equal

batch norm problem

I've recently been using batch norm in my code. And I discover that batch norm in your code is not used correctly. Hope to see this problem fixed.

Papers

In the readMe the links to the research papers are missing...

ValueError: Cannot feed value of shape (0,) for Tensor u'Placeholder:0', which has shape '(?, 64, 64, 3)'

When I try to run dcgan.py it returns me such error info:
Traceback (most recent call last):
File "dcgan.py", line 108, in
dcgan.train(sample_dir)
File "dcgan.py", line 58, in train
feed_dict={self.X: X_b, self.z: sample_z(batch_size, self.z_dim)}
File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1096, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (0,) for Tensor u'Placeholder:0', which has shape '(?, 64, 64, 3)'

Any suggestion?
My environment is: centos 7, tensorflow 1.4, cuda 8.0, cudnn 6.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.