Failed prediction error

hey! i have written exactly the same code as taught in lectures but im getting this failed prediction error in collab as well as in jupyter notebook.
Please help
“FailedPreconditionError Traceback (most recent call last)
in
17 real_y=np.ones((half_batch,1))0.9
18 fake_y=np.zeros((half_batch,1))
—> 19 d_loss_real=disc.train_on_batch(real_imgs,real_y)
20 d_loss_fake=disc.train_on_batch(fake_imgs,fake_y)
21 d_loss=0.5
d_loss_real+0.5*d_loss_fake”

Hey @Dr.Dang, let me help you with this error. Please replace this line of your code :

adam = Adam(lr=2e-4,beta_1=0.5)

by this line :

from tensorflow import keras
adam = keras.optimizers.Adam(learning_rate=2e-4,beta_1=0.5)

Hope this will help you !
Happy Learning :slight_smile:

this is the link to collab file

https://colab.research.google.com/drive/1j46q31RtqxZW855sPHgfoq7ui-xPNvzY?usp=sharing

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.