Unexpected grad_sample type: <class 'NoneType'>

I was trying to use opacus with DCGAN,while i am training Discriminator with fake images,
In the line of “opt_D.step()”,such value error happened,i can’t figure out what’s going wrong?PLEASE HELP

May I ask which version of Opacus you are using? Also, if you can provide a minimal reproducing code it would be easier for us to help you.

I just tried the dcgan example (opacus/dcgan.py at main · pytorch/opacus · GitHub) on my end and it seems to work well with Opacus 1.0


Thanks for your reply and test :grinning_face_with_smiling_eyes: