trainer.tune causes "No `train_dataloader()` method defined." error
Am I right in calling the tune method as follows?
trainer.tune(model, train_dataloader, val_dataloader) 
Here is the stacktrace of the error I am getting.
trainer.tune(model, train_dataloader, val_dataloader)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1052, in tune
    self.tuner.tune(model, train_dataloader, val_dataloaders, datamodule)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/tuner/tuning.py", line 63, in tune
    self.lr_find(model, update_attr=True)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/tuner/tuning.py", line 136, in lr_find
    self.setup_trainer(model, train_dataloader, val_dataloaders, datamodule)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/tuner/tuning.py", line 44, in setup_trainer
    self.trainer.train_loop.setup_fit(model, train_dataloader, val_dataloaders, datamodule)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/trainer/training_loop.py", line 120, in setup_fit
    self.trainer.config_validator.verify_loop_configurations(model)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/trainer/configuration_validator.py", line 36, in verify_loop_configurations
    self.__verify_train_loop_configuration(model)
  File "/opt/conda/envs/pl124/lib/python3.8/site-packages/pytorch_lightning/trainer/configuration_validator.py", line 58, in __verify_train_loop_configuration
    raise MisconfigurationException(
pytorch_lightning.utilities.exceptions.MisconfigurationException: No `train_dataloader()` method defined. Lightning `Trainer` expects as minimum a `training_step()`, `train_dataloader()` and `configure_optimizers()`
 to be defined.

trainer.fit(model, train_dataloader, val_dataloader) works fine. I don't define the data loader as a method in my model, rather I pass one in to my .fit methods. This seems to work well for the .fit method, but not for .tune.
FWIW, here is my model definition
class PretrainedResnet50FT(pl.LightningModule):
    
    @staticmethod
    def add_model_specific_args(parent_parser):
        parser = ArgumentParser(parents=[parent_parser], add_help=False)
        parser.add_argument('--num_classes', type=int, default=2)
        parser.add_argument('--lr', type=float, default=1e-3)
        return parser

    def __init__(self, hparams):
        super().__init__()
        self.hparams = hparams

        image_modules = list(models.resnet50(pretrained=True, progress=False).children())[:-1]
        self.resnet = nn.Sequential(*image_modules)
        self.classifier = nn.Linear(2048, self.hparams.num_classes)

    def forward(self, x):
        out = self.resnet(x)
        out = torch.flatten(out, 1)
        out = self.classifier(out)
        return out

    def step(self, who, batch, batch_nb):    
        x, task_labels, slide_id = batch
        
        #Define logits over the task and source embeddings
        task_logits = self(x)

        #Define loss values over the logits
        loss = task_loss = F.cross_entropy(task_logits, task_labels, reduction = "mean")                
                
        #Train acc
        task_preds = task_logits.argmax(-1)
        task_acc = pl.metrics.functional.accuracy(task_preds, task_labels)
        
        #F1
        task_f1 = pl.metrics.functional.f1(task_preds, task_labels, num_classes = self.hparams.num_classes)

        self.log(who + '_loss', loss)
        self.log(who + '_acc', task_acc)
        self.log(who + '_f1', task_f1)

        return loss

    def training_step(self, batch, batch_nb):
        # REQUIRED
        loss = self.step('train', batch, batch_nb)
        return loss

    def validation_step(self, batch, batch_nb):
        loss = self.step('val', batch, batch_nb)
        return loss
        
    def test_step(self, batch, batch_nb):
        loss = self.step('test', batch, batch_nb)
        return loss

    def configure_optimizers(self):
        return torch.optim.Adam(self.parameters(), lr=self.hparams.lr)
Arguments was not correctly passed from tune to lr_find. Was solved by this PR: #6784
Please upgrade to latest version of lightning :]