question: TypeError: 'Subset' object is not callable
context: I am getting this weird error TypeError: 'Subset' object is not callable
  class OurModel(LightningModule):
      def __init__(self):
          super(OurModel,self).__init__()
          #architecute
          self.model =  timm.create_model('efficientnetv2_rw_s', pretrained=True)
          self.dataset=torchvision.datasets.ImageFolder('./PSL DATA SET')
  
          self.train, self.val, self.test = torch.utils.data.random_split(self.dataset, [1009, 250, 250])
  
      def forward(self,x):
          x= self.model(x)
          return x
  
      def val_dataloader(self):
          print('val_dataloader')
          ds=DataLoader(MyLazyDataset(self.val,aug), batch_size = self.batch_size,num_workers=self.numworker, shuffle=False)
          print(len(ds))
          return ds
  
      def validation_step(self,batch,batch_idx):
          print('validation step')
          image,label=batch
          out=self(image).squeeze(1)
          loss=self.criterion(out,label.float())
          self.log('val_loss', loss)#use by early stopping
          return loss
  
  print statement shows len(ds) but it does not print 'validation step', so data from val_dataloader is not moving to validation_step
  Complete logs
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  <ipython-input-7-8edf32f6d94d> in <module>
        8 #trainer.tune(model)
        9 
  ---> 10 trainer.fit(model)
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in fit(self, model, train_dataloader, val_dataloaders, datamodule)
      458         )
      459 
  --> 460         self._run(model)
      461 
      462         assert self.state.stopped
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in _run(self, model)
      756 
      757         # dispatch `start_training` or `start_evaluating` or `start_predicting`
  --> 758         self.dispatch()
      759 
      760         # plugin will finalized fitting (e.g. ddp_spawn will load trained model)
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in dispatch(self)
      797             self.accelerator.start_predicting(self)
      798         else:
  --> 799             self.accelerator.start_training(self)
      800 
      801     def run_stage(self):
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/accelerators/accelerator.py in start_training(self, trainer)
       94 
       95     def start_training(self, trainer: 'pl.Trainer') -> None:
  ---> 96         self.training_type_plugin.start_training(trainer)
       97 
       98     def start_evaluating(self, trainer: 'pl.Trainer') -> None:
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py in start_training(self, trainer)
      142     def start_training(self, trainer: 'pl.Trainer') -> None:
      143         # double dispatch to initiate the training loop
  --> 144         self._results = trainer.run_stage()
      145 
      146     def start_evaluating(self, trainer: 'pl.Trainer') -> None:
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in run_stage(self)
      807         if self.predicting:
      808             return self.run_predict()
  --> 809         return self.run_train()
      810 
      811     def _pre_training_routine(self):
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in run_train(self)
      842             self.progress_bar_callback.disable()
      843 
  --> 844         self.run_sanity_check(self.lightning_module)
      845 
      846         self.checkpoint_connector.has_trained = False
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in run_sanity_check(self, ref_model)
     1110 
     1111             # run eval step
  -> 1112             self.run_evaluation()
     1113 
     1114             self.on_sanity_check_end()
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in run_evaluation(self, on_epoch)
      930 
      931         # enable eval mode + no grads
  --> 932         self.evaluation_loop.on_evaluation_model_eval()
      933         # ref model
      934         model = self.lightning_module
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py in on_evaluation_model_eval(self)
       87             model_ref.on_test_model_eval()
       88         else:
  ---> 89             model_ref.on_validation_model_eval()
       90 
       91     def on_evaluation_model_train(self) -> None:
  
  /opt/conda/lib/python3.7/site-packages/pytorch_lightning/core/hooks.py in on_validation_model_eval(self)
      195         Sets the model to eval during the val loop
      196         """
  --> 197         self.trainer.model.eval()
      198 
      199     def on_validation_model_train(self) -> None:
  
  /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in eval(self)
     1291             Module: self
     1292         """
  -> 1293         return self.train(False)
     1294 
     1295     def requires_grad_(self: T, requires_grad: bool = True) -> T:
answer: Reason train is a method thats why its throwing this error. Renaming self.train to self.trainx resolved the error. but I think logs should print this message