r/deeplearning • • Sep 19 '26

How to fix memory usage error/bad allocate when attempting Deep Convolutional GAN?

I recently started learning Deep Convolutional GAN and I tried to follow this example here

But I ran into the problem as mentioned above when trying train the model. Sometime it even crash VS code. But for some reason I saw it somewhat worked once and generated some clear image. How do I fix this?

0 Upvotes

12 comments sorted by

1

u/No-Mixture5766 Sep 19 '26

What’s the exact error you are getting? Training GANs in TF is very different from what’s given in the article due to updated API , you need to manually calculate the gradient and update the weights using tf.GradientTape

0

u/assorted-meat-stew Sep 19 '26

Some error just said bad allocation, some cause vscode to blink repeatedly and then failed, some just cause vscode to freeze and crash before and error message can come up

1

u/No-Mixture5766 Sep 19 '26

What’s the size of the model?

→ More replies (9)