Generative Adversarial Networks (GANs) in Keras - creating the combined model

I'm trying to create a pretty simple GANs model, and not sure how to combine the generator and the discriminator for training the generator from keras import optimizers from keras.layers import...

Why should the training label for Generator in GAN be always True?

I am currently learning deep learning especially GAN. I found a simple code of GAN from a web site...

Conditional GAN for domain translation

I am training a GAN to perform style transfer from two different image domains (source S and target T). Since I have available class information I have an extra Q network (except G and D) that...

RuntimeError: CUDA error: out of memory - DCGAN with image_size = 256

I am trying to implement a DCGAN with image_size = 256 (using PyTorch). I already implemented the generator and discriminator codes, in the following: class Generator(nn.Module): def init(self,...

CycleGAN with 1-channel tiffs both as input and as output

I am running CycleGAN with different types of tiffs in trainA and trainB. The tiffs are 256x256 pixels in size and have 1 channel per pixel. I am using tiffs to have a wide range of values. I...

Resolve exploding gradient in VAE

How do you resolve exploding gradient in a deep generative model(VAE)? NB: the data-set contains a lot of NaNs values in the columns

AttributeError: module 'tensorboard' has no attribute 'lazy'

I have a generative adversarial network using Keras with a tensorflow backend. I am running Tensorflow 1.14.0, Python 3.7.4, and Keras 2.2.4. The full error is: Using TensorFlow backend. Traceback...

Tensorflow 2.0: How to change the output signature while using tf.saved_model

I would like to change the input and output signatures of the model saved, I used tf.Module objects to build the operations of the main model. class Generator(tf.Module): def __init__(....): ...

I keep getting an Assertion Error with StyleGAN

Recently I have been playing around with StyleGAN and I have generated a dataset but I get the following when I try to run train.py. 2020-01-08 13:33:21.943217: I...

Why is tf.keras BatchNormalization causing GANs to produce nonsense loss and accuracy?

Background: I've been getting unusual losses and accuracies when training GANs with batch normalization layers in the discriminator using tf.keras. GANs have an optimal objective function value of...

How to use Tensorflow's cycleGAN on my own dataset

I am trying to use the code there: https://www.tensorflow.org/tutorials/generative/cyclegan on my own data. In this tutorial a Dataset object is created with this code: dataset, metadata =...

tensorflow error: "No OpKernel was registered to support Op 'TPUReplicatedInput'" when restoring model

(Novice question; sorry in advance.) I have a pretrained (BigGAN) tensorflow model that another user developed to create images, and I would like to use it to generate new images. (If it helps to...

How to implement skip connections from MSG-GAN paper

I am trying to implement the technique described in the MSG-GAN paper: https://arxiv.org/pdf/1903.06048.pdf But I am having difficulty understanding some things, for example, how are the...

Poor DCGAN performance when upgrading from keras to tf.keras

Update 1: When removing the batch normalisation layers it works well. Apparently the way batch normalisation works was changed between iterations. Still investigating. Update 2: Questions below...

Scene Text Image Super-Resolution for OCR

I am working on an OCR system. A challenge that I'm facing for recognizing the text within ROI is due to the shakiness or motion effect shot or text that is not focus due to angle positions....

StyleGAN2-ada, Runtime runs, but epoch stays at zero

I run it on the Colab runtime runs.... But even if I wait for more than 5 hours, epoch doesn't go up. Is there any problem should I check?? !nvidia-smi > NVIDIA-SMI 455.32.00 Driver Version:...

Why do I got NaN (loss) values in training Wasserstein GAN with Gradient Penalty?

Recently, I worked with GANs for generating fake accelerometer data for human activity (i.e., mHEALTH dataset). I have tried to implement Improved Technique for Training GAN (i.e., Conditional...

ValueError: No gradients provided for any variable in TensorFlow when building a GAN

I'm trying to build a GAN for a university assignment. My code is very similar to the intro example in this tutorial from TF's website. Below are what I think the relevant parts of the code (can...

Stylegan2-ada tfrecords - ValueError: axes don't match array, images will work one run and not work the next

I'm working on training a GAN through Google Colab with a dataset of photos I scraped from Wikiart and converted to 1024x1024, but keep getting this error when creating the tfrecords: Traceback...

Converting a spectrogram image back to audio

I have generated some Mel-spectrograms using librosa to use it for generative adversarial networks(GANs). I have saved the generated spectrograms through GAN in image format(.png). Now I am trying...

VQGAN+CLIP style control

I'm working with VQGAN+CLIP. Is there any controlled way to influence the style of the images created through the text prompt? For example, there are discussions on Twitter and Reddit about adding...

Updating Unrolled GAN to TF2

I am trying to implement the Unrolled GAN model as described here, with example code. However, it was implemented using TF1, and I have been doing my best to update it but I am relatively new to...

Open Ai's CLIP and image databases

Using Open Ai's CLIP with BigGAN, VQGAN etc. are there image databases other than: ImageNet 1024, ImageNet 16384, COCO,S-FLCKR, WikiArt, FacesHQ that can be used? If so what others?

ValueError: Sample larger than population or is negative

i am following this tutorial to implement GAN https://github.com/krantirk/Credit-GANS/blob/master/creditcard_GANs.ipynb but i got this error can anyone help? i got this error fraud_wilcox =...

After some number of epochs fake image creation become worst in GAN

I'm trying to create GAN model. This is my discriminator.py import torch.nn as nn class D(nn.Module): feature_maps = 64 kernel_size = 4 stride = 2 padding = 1 bias = False ...

Difference between WGAN and WGAN-GP (Gradient Penalty)

I just find that in the code here: https://github.com/NUS-Tim/Pytorch-WGAN/tree/master/models The "generator" loss, G, between WGAN and WGAN-GP is different, for WGAN: g_loss =...

How to fine tune a pre-trained GAN?

I would like to fine tune a pre-trained GAN available online using my own images. For example, BigGAN, which was trained on ImageNet, can generate realistic images. However, I do not want to...

AttributeError: 'ReLU' object has no attribute 'dim'

I am building a GAN, and my discriminator function is defined as class Discriminator(nn.Module): def __init__(self): super(Discriminator, self).__init__() self.fc1 = nn.Linear(50*15, 32) ...

How to save and resume training a GAN with multiple model parts with Tensorflow 2/ Keras

I am currently trying to add a feature to interrupt and resume training on a GAN created form this example code:...

DCGAN understanding generator update step

Here is some DCGAN example in Pytorch: https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html#training I wonder why we don't zero discriminator gradients before we update generator? (I...