소스 검색

fix: AttributeError

shellmiao 1 년 전
부모
커밋
d07799a223
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      applications/fedssl/client_with_pgfed.py

+ 1 - 1
applications/fedssl/client_with_pgfed.py

@@ -90,7 +90,7 @@ class FedSSLWithPgFedClient(FedSSLClient):
 
         self.loss_minus = 0.0
         test_num = 0
-        self.optimizer.zero_grad()
+        optimizer.zero_grad()
         for (batched_x1, batched_x2), _ in self.train_loader:
             x1, x2 = batched_x1.to(self.device), batched_x2.to(self.device)
             test_num += x1.size(0)