Unwrapping the module did not yield a `LightningModule`
I am getting an error running the validate() function of pytorch lighting using the following code.
error:
ValueError: An invalid dataloader was passed to `Trainer.validate(dataloaders=...)`. Either pass the dataloader to the `.validate()` method OR implement `def val_dataloader(self):` in your LightningModule/LightningDataModule.

code:
from torchvision.datasets import MNIST
from torchvision import transforms
from torch.utils.data import DataLoader
...
mnist_val = MNIST(root='data',train=False, download=True, transform=transform)
mnist_val_loader = DataLoader(mnist_val, batch_size=256, num_workers=4)
...
trainer.validate()

I used the data loader into the validate() function but I get the following error:
Unwrapping the module did not yield a `LightningModule`


I solved with the newer versions of pytorch_lighting putting as input model &amp; data loader to trainer.validate()
trainer.validate(model, mnist_val_loader)

