C1 w1 - unq_c6:

Hi all,
I’m stuck with this general error that is not giving any hint about what I’m doing wrong


AssertionError Traceback (most recent call last)
Input In [51], in <cell line: 73>()
70 if num_steps >= max_tests:
71 break
—> 73 test_disc_reasonable()
74 test_disc_loss()
75 print(“Success!”)

Input In [51], in test_disc_reasonable(num_images)
12 real = torch.ones(num_images, z_dim)
13 disc_loss = get_disc_loss(gen, disc, criterion, real, num_images, z_dim, ‘cpu’)
—> 14 assert torch.all(torch.abs(disc_loss.mean() - 0.5) < 1e-5)
16 gen = torch.ones_like
17 criterion = torch.mul # Multiply

AssertionError:

Any help is appreciated

Thanks

Andrea

You’re right that the error doesn’t really tell you anything other than that your gen_disc_loss implementation is incorrect. Meaning it doesn’t tell you what to look for in terms of errors. My suggestion is just to read the instructions again carefully and then compare that to what you wrote. In terms of hints, the key is that since this is the discriminator loss we are defining, we want it to think the fake images are fake (compare to “all zeros”) and we want it to think the real images are real (compare the result to “all ones”), right?

If you’ve already done that, then I guess we’ll need to look at your code. We’re not supposed to do that in a public way, but there is a private way to do that. I’ll send you a DM in a sec …

Thanks Paul!

You suggestion about carefully check when to compare to “all zeros” and when to “all ones” was decisive.

Thanks again

Andrea

Hi, Andrea.

It’s great to hear that you were able to find the solution just based on that hint!

Onward! :nerd_face:

Regards,
Paul