G_sample = netG.forward(noise, label)
    D_real = netD.forward(mnist_img, label)
    D_fake = netD.forward(G_sample.detach(), label)

    D_loss_real = criterion(D_real, ones_label)
    D_loss_fake = criterion(D_fake, zeros_label)
    D_loss = D_loss_real + D_loss_fake

    netD.zero_grad()
    D_loss.backward()
    D_solver.step()
   

    netG.zero_grad()
    netD.zero_grad()
    G_sample = netG.forward(noise, label)
    output = netD.forward(G_sample, label)

    G_loss = criterion(output, ones_label)
    G_loss.backward()
    G_solver.step()

error info: 
QQ图片20170502122130.png1535×177 13.6 KB

who can tell me why ?  i have been trying to solve the problem for long. thanks very much !