I have a problem that when using trainer.fit(model), my def val_loader is never used, only train_loader
Also when using trainer.test(model), my def val_loader and def test_loader are never used, only train_loader.
How do I change this? I cant share code but the structure is like this:
- imports
- class modelModule(LightningModule)
def model
…
def training_step
def validation_step
def validation_epoch_end
def test_step
def test_end
def train_dataloader
def val_dataloader
def test_dataloader - if name == “main”:
model = modelModule()
trainer.Trainer(gpus=1, max_epochs=20, num_nodes=1, precision=16, overfit_batches=1)
trainer.fit(model)
trainer.test(model)
SOLUTION: not use “overfit_batches” in trainer