awslabs / fast-differential-privacy

Fast, memory-efficient, scalable optimization of deep learning with differential privacy
Apache License 2.0
83 stars 11 forks source link

Bug in PrivacyEngine #16

Closed shuqike closed 9 months ago

shuqike commented 9 months ago

The term self.optimizer only appears in the function detach() of PrivacyEngine.

That means it leads to AttributeError when you call privacyengine.detach().

So we cannot run the example file CIFAR_TIMM_2phase.py properly.

woodyx218 commented 9 months ago

Fixed. Added one line at L310 https://github.com/awslabs/fast-differential-privacy/blob/main/fastDP/privacy_engine.py