yfeng95 / gan Goto Github PK
View Code? Open in Web Editor NEWResources and Implementations of Generative Adversarial Nets: GAN, DCGAN, WGAN, CGAN, InfoGAN
Resources and Implementations of Generative Adversarial Nets: GAN, DCGAN, WGAN, CGAN, InfoGAN
Why does the first param of the functions from line 28 to line 30 in nets.py is z
rather than g
?
About the infogan, how to display the results of the latent variables
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)
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
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~
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?
如果GAN训练收敛了, 之后固定G,再接着训练D,那么D还可以判断出来是否是G生成的图片吗?
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.
I need to use transfer learning for gan.
I wonder if the pretrained discriminator need to be transferred or is it ok to only transfer the pretrained generator?
where's the celeba dataset?
In the readMe the links to the research papers are missing...
微信:lovedaixiaobaby
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.