kozistr / awesome-gans Goto Github PK
View Code? Open in Web Editor NEWAwesome Generative Adversarial Networks with tensorflow
License: MIT License
Awesome Generative Adversarial Networks with tensorflow
License: MIT License
Hi @kozistr, Thanks for your great work!
In your CGAN implementation, you feed G and D with the same real label from the dataset as the condition.However, I have a question about this since several other implementations feed G with a sampled label as the condition.
I have seen several CGAN implementations. There are two ways to use the condition labels:
Here are my questions:
The same issue has been asked here. I hope we can figure out it together.
In the lapgan_train.py, the 56th line says:
batch_images = batch_images.astype(np.float32) / 225.
Why it is 225 instead of 255?
Adding visual contents would be good #14
Hello! I've found a performance issue in /awesome_gans/pggan/pggan_train.py: with tf.Session(config=config) as s
(here) is repeatedly called in the loop for idx, n_pg in enumerate(pg)
(here).
tf.Session
being defined repeatedly could lead to incremental overhead. If you define tf.Session
out of the loop and pass tf.Session
as a parameter to the loop, your program would be much more efficient. Here is the Stack Overflow post to support it.
Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
It's just not worked well... It'll be fixed soon
Image generation has a problem. (maybe, entire model...)
now on going ~
hi @kozistr thank you for your hard and great work
could you please explain to me how to use your srgan to upscale my own photo
thank you
Is it possible for you to have an annual review of new GANs that arrives on the scene through https://github.com/nightrome/really-awesome-gan?
P.S. it would be nice if you can draw a diagram for each of the GANs and explain how they differ, and maybe create a generalized GAN interface so that people can hot-swap whatever CNNs they would like to use from https://github.com/CeLuigi/models-comparison.pytorch/wiki/Accuracy-vs-Computational-complexity for more diverse designs.
@kozistr When I try to run your code, then I am getting a out of memory error. I looked at it and apparently, when you are loading the data, you are storing all images in memory at once, which is causing this error. Can you help me in this matter?
Currently, there're GANs that don't work properly with some reasons that i didn't find yet, but not in the past,
Need to be fixed. Any helps or suggestions are welcome :)
Could you show your "list_attr_celeba.txt" used in the infogan folder? I have made the txt file myself, but it doesn't work well, plz!
In run-time, loss became NaN...
now on re-modeling & building for real SR images...
Hello,
I am trying to run CoGAN, but I get the following error below:
Traceback (most recent call last):
File "cogan_train.py", line 131, in
main()
File "cogan_train.py", line 42, in main
model = cogan.CoGAN(s)
File "/home/maria/Documents/Awesome-GANs/CoGAN/cogan_model.py", line 166, in init
self.build_cogan() # build CoGAN model
File "/home/maria/Documents/Awesome-GANs/CoGAN/cogan_model.py", line 224, in build_cogan
self.g_1 = self.generator(self.z, self.y, share_params=False, reuse=False, name='g1')
File "/home/maria/Documents/Awesome-GANs/CoGAN/cogan_model.py", line 196, in generator
x = tf.layers.dense(x, 7 * 7, reuse=True, name='gen-dense-reshape')
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/layers/core.py", line 250, in dense
return layer.apply(inputs)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 671, in apply
return self.call(inputs, *args, **kwargs)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 559, in call
self.build(input_shapes[0])
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/layers/core.py", line 137, in build
trainable=True)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 458, in add_variable
trainable=trainable and self.trainable)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1203, in get_variable
constraint=constraint)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1092, in get_variable
constraint=constraint)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 425, in get_variable
constraint=constraint)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 394, in _true_getter
use_resource=use_resource, constraint=constraint)
File "/home/maria/anaconda2/envs/anaconda3gpu/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 760, in _get_single_variable
"reuse=tf.AUTO_REUSE in VarScope?" % name)
ValueError: Variable generator-g1/gen-dense-reshape/kernel does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
Any help would be greatly appreciated! Thank you in advance.
Describe the bug
In the file "fgan_model.py":
(1) Line 209, the conjugate function of Total-Variation in your code is supposed to be the same as the activation function. Since in your implementation, the conjugate function should be f*(g(x)) where x is the input. Thus, for Total Variation, f*(g(x))=g(x) rather than x;
I think it should be: -torch.mean(torch.tanh(x) / 2.) ?
(2) The conjugate of Jenson-Shannon is also incorrect? Line159;
I think it should be: -torch.mean(x + torch.log(1. + torch.exp(-x))) - torch.log(torch.tensor(2.))?
(3) The conjugate of Hellinger is also incorrect? Line175.
I think it should be: -torch.mean((1. - torch.exp(x)) / (torch.exp(x)))?
I find PGGAN can not train.
When pg ==1, generator make the fake image which shape is [-1,16,16, 3].
And i find reason: because generator has upsample twice on line of block the pggan_model.py .
repair
x = block(x, nf(i + 1), name="1")
# x = block(x, nf(i + 1), name="2")
x = tf.layers.conv2d(x, filters=get_out_channels(i + 1), kernel_size=3, strides=1, padding='SAME',
kernel_initializer=w_init, kernel_regularizer=w_reg, bias_initializer=b_init,
name='gen_n_%s_conv2d-%d' % (name, x.get_shape()[1]))
x = tf.nn.leaky_relu(x)
x = pix_norm(x)
Currently, there're lots of duplicates of codes. and hard to use and read.
So, modulizing and refactoring the code is needed.
Hi There,
This project is still using an old implementation of LGTM's automated code review, which has now been disabled. To continue using automated code review, and receive checks on your Pull Requests, please install the GitHub App on this repository.
Thanks,
The LGTM Team
Currently, all of the codes are based on tensorflow 1.x
, which is legacy.
so, rework all codes to pytorch code, instead of tensorflow 2.x
Currently, using h5py for saving images.
Later, it'll be changed to TFRecord, overall.
And kinda image normalize like dividing into 255.0, it'll be also removed from datasets.py
Or by option :).
Anyway, in short, datasets.py reformed soon!
i can not understand the difference between batch_a and batch_b in stargan
Describe the bug
Trying to follow the README.md
and code does nothing.
To Reproduce
Steps to reproduce the behavior:
README.md
instructions to train GANspython3 -m awesome_gans.acgan
Expected behavior
GAN should train
Additional context
This isn't entirely unexpected since the code for awesome_gans.acgan
(i.e. acgan/__main__.py
) is essentially blank as shown below. I'm wondering if this ever worked, or if something is very out of date.
from awesome_gans.config import parse_args
from awesome_gans.utils import set_seed
def main():
config = parse_args()
set_seed(config.seed)
if config.mode == 'train':
pass
elif config.mode == 'inference':
pass
else:
raise ValueError()
main()
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.