Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor DCGAN (chapter 5) performance when upgrading from keras to tf.keras #14

Open
FaizSayyid opened this issue Nov 9, 2020 · 1 comment

Comments

@FaizSayyid
Copy link

I'm trying to run the DCGAN from chapter 5; the code performs well and the generated images are good.

But when I change the source code so that it becomes compatible with tf.keras rather than keras, the model produces useless images that are obviously just noise

The following is the only bit of the code I've changed. From:

%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

from keras.datasets import mnist
from keras.layers import Activation, BatchNormalization, Dense, Dropout, Flatten, Reshape
from keras.layers import LeakyReLU
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Sequential
from keras.optimizers import Adam

to:

%matplotlib inline

import matplotlib.pyplot as plt
import numpy as np

from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Activation, BatchNormalization, Dense, Dropout, Flatten, Reshape
from tensorflow.keras.layers import LeakyReLU
from tensorflow.keras.layers import Conv2D, Conv2DTranspose
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam

I've even tried to enforce tf_1 compatability with

tf.compat.v1.disable_v2_behavior()

but performance remains poor. Any ideas?

@Nevermetyou65
Copy link

Nevermetyou65 commented Oct 22, 2021

I faced this too and there is really no answer anywhere but I found that there is a tutorial in tensorflow website.

https://www.tensorflow.org/tutorials/generative/dcgan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants