skip-GANomaly-MvTec-grid icon indicating copy to clipboard operation
skip-GANomaly-MvTec-grid copied to clipboard

Target and input must have the same number of elements. target nelement (20) != input nelement (3380)

Open DeepKnowledge1 opened this issue 4 years ago • 2 comments

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)

DeepKnowledge1 avatar Jan 06 '21 11:01 DeepKnowledge1

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.

qqsuhao avatar Jan 14 '21 03:01 qqsuhao

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

FdKing9494 avatar Jul 07 '22 01:07 FdKing9494