Comments (5)
I encountered the same issue with InfoGAN
On the tensorflow page for BatchNormalization it says that there was a behavioral change between TF 1.x and 2
setting trainable = False on the layer means that the layer will be subsequently run in inference mode [...] This behavior only occurs as of TensorFlow 2.0. In 1.*, setting layer.trainable = False would freeze the layer but would not switch it to inference mode.
Changing the import statement for BatchNormalization to
from tensorflow.compat.v1.keras.layers import BatchNormalization
Seems to fix the issue and produces the output you'd expect (at least, in InfoGAN's case).
Note: To get the InfoGAN example script to run on the current TF build, the import statements needed to be changed to
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout
from tensorflow.keras.layers import Activation, Embedding, ZeroPadding2D, Lambda
from tensorflow.compat.v1.keras.layers import BatchNormalization
from tensorflow.keras.layers import LeakyReLU
from tensorflow.keras.layers import UpSampling2D, Conv2D
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.utils import to_categorical
import tensorflow.keras.backend as K
from keras-gan.
In the book, they did not actually explicitly wrote the learning rate. The typical learning rate for RmsProp is 0.0002 Or 0.00005 as seen in most of the papers. This may be one of the problem as dcgan require learning rate tuning.
from keras-gan.
In the book, they did not actually explicitly wrote the learning rate. The typical learning rate for RmsProp is 0.0002 Or 0.00005 as seen in most of the papers. This may be one of the problem as dcgan require learning rate tuning.
I finally solved this problem.
I have tried to downgrade keras to version 2.3.1 and it was working.
But I don't know why keras 2.4.3 is generating noise
from keras-gan.
I also tried this tutorial and found that it would help to add parameters here
model.add(BatchNormalization(momentum=0.8))
from keras-gan.
Use Spectral Normalization on top of CONV2D of Discriminator will stabilize the training greatly. Also, pay attention to kernel_initializer (glorot_normal etc...)
from keras-gan.
Related Issues (20)
- when training CGAN, raise AttributeError: 'list' object has no attribute 'keys' in the following code HOT 5
- About pix2pix cannot be executed
- [Pix2Pix] Use fit_generator to speed up training process
- Why d_loss = 0.5 * np.add(d_loss_real, d_loss_fake) ? HOT 7
- cGAN: Using Multi label with different number of classes
- (WGAN_GP)BatchNormalization in critic
- Adversarial Autoencoder training procedure does not correspond to procedure described in paper
- SRGAN - Generated image got PINK overlay all the time ? How to solve this ? HOT 1
- StarGAN & StyleGAN any chance ?
- Cannot import 'Adam' for keras optimizers while testing acgan HOT 1
- ACGAN: Difference multiplication and concatenation of embedding and noise
- pix2pix download dataset
- ImportError: cannot import name 'DataLoader' from 'data_loader'
- Where can I find and download some pre-trained model?
- Project dependencies may have API risk issues
- SRGAN dataset is not available
- when training SGAN for cifar10 and mnist dataset, raised the "AttributeError: 'list' object has no attribute 'keys' "in the following code lones
- cGAN with multi-labels of multi-classes HOT 1
- Keras GAN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-gan.