Skip to content

Commit

Permalink
Minor fixes (BiC)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrzpellegrini committed Jan 24, 2024
1 parent 5749629 commit 3ced031
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion avalanche/training/plugins/bic.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def after_training_exp(self, strategy, **kwargs):
# Make sure that the old_model is frozen (including batch norm layers)
# requires_grad=False is not sufficient to freeze BN layers,
# we also need eval()
self.model_old = None
self.model_old = deepcopy(strategy.model)
self.model_old.eval()
for param in self.model_old.parameters():
Expand Down Expand Up @@ -381,7 +382,7 @@ def bias_correction_step(
batch_size=strategy.train_mb_size,
shuffle=True,
num_workers=self.num_workers,
persistent_workers=persistent_workers,
persistent_workers=persistent_workers if self.num_workers > 0 else False,
)

# Loop epochs
Expand Down

0 comments on commit 3ced031

Please sign in to comment.