IndexError: pop from empty list

/usr/local/lib/python3.10/dist-packages/opacus/grad_sample/grad_sample_module.py in rearrange_grad_samples(self, module, backprops, loss_reduction, batch_first)
396 batch_dim=batch_dim,
397 )
ā†’ 398 activations = module.activations.pop()
399
400 n = module.max_batch_len

IndexError: pop from empty list
Hi I tried all possible code for differential privacy in time series but end up with this error. Please help. I am using this code # Privacy engine hyper-parameters
max_per_sample_grad_norm = 1.5
delta = 8e-5
epsilon = 12.0

# criterion = CustomLoss().to(device)

optimizer = torch.optim.Adam(net.parameters(), lr=0.05)
from opacus import PrivacyEngine
privacy_engine = PrivacyEngine()

model, optimizer, train_loader = privacy_engine.make_private_with_epsilon(
module =net,
optimizer=optimizer,
data_loader=trainloader,
max_grad_norm=max_per_sample_grad_norm,
target_delta=delta,
target_epsilon=epsilon,
epochs=epochs,
)