Closed cathylacus closed 3 years ago
I can‘t find the val_data_iterator,The code is training.py def compute_val_loss(self): self.model.eval()
sum_val_loss = 0 num_batches = 15 for _ in range(num_batches): try: val_batch = self.val_data_iterator.next() except: self.val_data_iterator = self.val_dataset.get_loader().__iter__() val_batch = self.val_data_iterator.next() sum_val_loss += self.compute_loss( val_batch).item() return sum_val_loss / num_batches
I can‘t find the val_data_iterator,The code is training.py def compute_val_loss(self): self.model.eval()