You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement augmentation multiplicity (as implemented in Paper 1 and Paper 2 ) using Opacus's new functionality of functorch. I am following the exact steps as pointed out by @alexandresablayrolles in #455 and #575.
However, I am facing a bug in the predictions = fmodel(params, batch) line where it says that AttributeError: 'Tensor' object has no attribute '_forward_counter'. My intuition is that the attribute _forward_counter should be added to the model while calling make_functional() but there has been some code change which might be causing this.
This problem arises when using functorch on models with added hooks. However, both functorch and the hook serve the purpose of calculating per-sample gradients. Therefore, their coexistence is unnecessary. A fix is to leverage "no_op" grad_sample_module which does not add hooks:
🐛 Bug
I am trying to implement augmentation multiplicity (as implemented in Paper 1 and Paper 2 ) using Opacus's new functionality of functorch. I am following the exact steps as pointed out by @alexandresablayrolles in #455 and #575.
However, I am facing a bug in the
predictions = fmodel(params, batch)
line where it says thatAttributeError: 'Tensor' object has no attribute '_forward_counter'
. My intuition is that the attribute _forward_counter should be added to the model while callingmake_functional()
but there has been some code change which might be causing this.Any help is appreciated. Thanks!
Colab reproducible link
To Reproduce
Expected behavior
I would expect the forward function to work with the new functorch functionality.
The text was updated successfully, but these errors were encountered: