jchibane / if-net

Implicit Feature Network (IF-Net) - Codebase
311 stars 57 forks source link

AttributeError: 'Trainer' object has no attribute 'val_data_iterator' #21

Closed cathylacus closed 3 years ago

cathylacus commented 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