davidADSP / GDL_code

The official code repository for examples in the O'Reilly book 'Generative Deep Learning'
GNU General Public License v3.0
1.47k stars 739 forks source link

WGAN-GP implementation incompatible with TensorFlow 2.x #67

Open DCtheTall opened 4 years ago

DCtheTall commented 4 years ago

FWIW the WGAN-GP implementation in this repo, as the issue title suggests, breaks when you try to use TensorFlow 2.x. When you try to use the current implementation K.gradients() returns None when computing the gradient penalty loss.

I am not sure if this book is intentionally restricted to TF 1.x, but it might be nice to mention this breakage somewhere?

There's an implementation of a WGAN-GP using Keras and TensorFlow here (this code has the WGAN-GP extend the keras.models.Model class but I don't think that is actually necessary).

arisliang commented 3 years ago

Have you tried the tensorflow_2 branch?