andrewliao11 / cogan-tensorflow Goto Github PK
View Code? Open in Web Editor NEWImplement Coupled Generative Adversarial Networks in Tensorflow
Implement Coupled Generative Adversarial Networks in Tensorflow
I tried it on v1.1.0 and got the following error:
//--------------------------------
ValueError: Variable g_bn0/g_bn0_2/moments_1/moments_1/mean/ExponentialMovingAverage/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?
//--------------------------------
It seems you had fix it once?
Thanks.
Hi,
Thank you for this neat and clean code of CoGAN. I have one comment:
The architecture you have given is giving very good results on MNIST dataset. But, generating nothing but noise on other datasets like: CIFAR 10, Fashion MNIST, LSUN and SVHN.
I will be very much obliged if you share with me necessary hacks to get good results on those datasets too.
With Best Regards,
Arghya Pal.
When running the training codes, there exists one problem: "ValueError: No gradients provided for any variable, check your graph for ops that do not support gradients". How to solve it? Thanks.
hello, thank you for make this project! ^_^
in the "ops.py" line 39:
with tf.variable_scope(tf.get_variable_scope(), reuse=False):
ema_apply_op = self.ema.apply([batch_mean, batch_var])
but in
Signature: tf.variable_scope(name_or_scope, default_name=None, values=None, initializer=None, regularizer=None, caching_device=None, partitioner=None, custom_getter=None, reuse=None, dtype=None, use_resour
ce=None)
Args:
reuse: True
or None
; if True
, we go into reuse mode for this scope as well as all sub-scopes; if None
, we just inherit the parent scope reuse.
when I run the code, it said:
Traceback (most recent call last):
File "main.py", line 51, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 41, in main
dataset_name=FLAGS.dataset, is_crop=FLAGS.is_crop, checkpoint_dir=FLAGS.checkpoint_dir)
File "/home/hzq/Glass/GeneGAN_datagate/CoGAN-tensorflow-master/model.py", line 68, in init
self.build_model()
File "/home/hzq/Glass/GeneGAN_datagate/CoGAN-tensorflow-master/model.py", line 96, in build_model
self.G2 = self.generator(self.z, self.y, share_params=True, reuse=False, name='G2')
File "/home/hzq/Glass/GeneGAN_datagate/CoGAN-tensorflow-master/model.py", line 308, in generator
h0 = prelu(self.g_bn0(linear(z, self.gfc_dim, 'g_h0_lin', reuse=share_params), reuse=share_params),
File "/home/hzq/Glass/GeneGAN_datagate/CoGAN-tensorflow-master/ops.py", line 39, in call
ema_apply_op = self.ema.apply([batch_mean, batch_var])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 375, in apply
colocate_with_primary=(var.op.type in ["Variable", "VariableV2"]))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 174, in create_zeros_slot
colocate_with_primary=colocate_with_primary)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 149, in create_slot_with_initializer
dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 66, in _create_slot_var
validate_shape=validate_shape)
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 367, in get_variable
validate_shape=validate_shape, 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_bn0/g_bn0_2/moments_1/Squeeze/ExponentialMovingAverage/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?
my tensorflow version : tf.version = 1.2.1
can you help me?
thank you !
Which verson of Tensorflow is required for CoGAN-tensorflow? I tried it on v0.12.1 and got the following error:
$ python main.py --is_train True --dataset mnist I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally {'batch_size': 128, 'beta1': 0.5, 'c_dim': 3, 'checkpoint_dir': 'checkpoint', 'dataset': 'mnist', 'epoch': 25, 'is_crop': False, 'is_train': True, 'learning_rate': 0.0002, 'output_size': 64, 'sample_dir': 'samples', 'train_size': inf, 'visualize': False} I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: name: GRID K520 major: 3 minor: 0 memoryClockRate (GHz) 0.797 pciBusID 0000:00:03.0 Total memory: 3.94GiB Free memory: 3.91GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GRID K520, pci bus id: 0000:00:03.0) WARNING:tensorflow:From /mnt/ml/tests/CoGAN-tensorflow/model.py:87 in build_model.: histogram_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30. Instructions for updating: Please switch to tf.summary.histogram. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on their scope. Traceback (most recent call last): File "main.py", line 51, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run sys.exit(main(sys.argv[:1] + flags_passthrough)) File "main.py", line 41, in main dataset_name=FLAGS.dataset, is_crop=FLAGS.is_crop, checkpoint_dir=FLAGS.checkpoint_dir) File "/mnt/ml/tests/CoGAN-tensorflow/model.py", line 68, in __init__ self.build_model() File "/mnt/ml/tests/CoGAN-tensorflow/model.py", line 96, in build_model self.G2 = self.generator(self.z, self.y, share_params=True, reuse=False, name='G2') File "/mnt/ml/tests/CoGAN-tensorflow/model.py", line 309, in generator h0 = prelu(self.g_bn0(linear(z, self.gfc_dim, 'g_h0_lin', reuse=share_params), reuse=share_params), File "/mnt/ml/tests/CoGAN-tensorflow/ops.py", line 37, in __call__ ema_apply_op = self.ema.apply([batch_mean, batch_var]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 391, in apply self._averages[var], var, decay, zero_debias=zero_debias)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 70, in assign_moving_average update_delta = _zero_debias(variable, value, decay) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 177, in _zero_debias trainable=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 1024, in get_variable custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 850, in get_variable custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 346, in get_variable validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 331, in _true_getter caching_device=caching_device, validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 650, in _get_single_variable "VarScope?" % name) ValueError: Variable g_bn0/g_bn0_2/g_bn0_2/moments_1/moments_1/mean/ExponentialMovingAverage/biased does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?
I'd like to the try this code on the celebA dataset, mainly for reproducing the faces+attributes test (see Figure 4 in the original paper). I noticed that there is a celebA class in utils.py that references a file named split_img.npz. Where can I find this file? It does not seems to be on the website http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html referenced in the original paper. Thanks!
In original implementation, domain adaptation transfer task has been done i.e., USPS to MNIST or MNIST to USPS. Could you include these experiments please?
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.