skip-GANomaly-MvTec-grid
skip-GANomaly-MvTec-grid copied to clipboard
Target and input must have the same number of elements. target nelement (20) != input nelement (3380)
I changed the batchsize = 20, in line 117, disc_loss_real = L_adv_disc(D_real, label_real.detach()) i got this error, Target and input must have the same number of elements. target nelement (20) != input nelement (3380)
I run my program for one epoch, but not got this error. I suggest that you could print the size of "D_real" and "label_real" during running the program.
The reason for this problem is that you have changed the size of the generated image, resulting in an error in the output result of the discriminator model. If you have to modify the size of the generated image, you need to modify the network structure