question: AttributeError: 'Trainer' object has no attribute 'run_evaluation'
context: I am getting the below error when running trainer.fit:
  AttributeError: 'Trainer' object has no attribute 'run_evaluation'
  Full traceback:
  Traceback (most recent call last):
    File "sdr_main.py", line 81, in <module>
      main()
    File "sdr_main.py", line 28, in main
      main_train(model_class_pointer, hyperparams,parser)
    File "sdr_main.py", line 73, in main_train
      trainer.fit(model)
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 741, in fit
      self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
      return trainer_fn(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
      self._run(model, ckpt_path=ckpt_path)
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
      self._dispatch()
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
      self.training_type_plugin.start_training(self)
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
      self._results = trainer.run_stage()
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
      return self._run_train()
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1319, in _run_train
      self.fit_loop.run()
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/base.py", line 140, in run
      self.on_run_start(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/fit_loop.py", line 200, in on_run_start
      self.trainer.call_hook("on_train_start")
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1495, in call_hook
      callback_fx(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/callback_hook.py", line 138, in on_train_start
      callback.on_train_start(self, self.lightning_module)
    File "/content/SDR/utils/pytorch_lightning_utils/callbacks.py", line 10, in on_train_start
      return trainer.run_evaluation()
  AttributeError: 'Trainer' object has no attribute 'run_evaluation'
  
  My Trainer object:
  trainer = pytorch_lightning.Trainer(
      num_sanity_val_steps=2,
      gradient_clip_val=hparams.max_grad_norm,
      callbacks=[RunValidationOnStart()],
      checkpoint_callback=ModelCheckpoint(
          save_top_k=3,
          save_last=True,
          mode="min" if "acc" not in hparams.metric_to_track else "max",
          monitor=hparams.metric_to_track,
          dirpath=model.hparams.hparams_dir,
          filename="{epoch}",
          verbose=True,
      ),
      logger=logger,
      max_epochs=hparams.max_epochs,
      gpus=hparams.gpus,
      strategy="dp",
      limit_val_batches=hparams.limit_val_batches,
      limit_train_batches=hparams.limit_train_batches,
      limit_test_batches=hparams.limit_test_batches,
      check_val_every_n_epoch=hparams.check_val_every_n_epoch,
      profiler=SimpleProfiler(),
      accumulate_grad_batches=hparams.accumulate_grad_batches,
      reload_dataloaders_every_epoch=True,
      resume_from_checkpoint=hparams.resume_from_checkpoint,
  )
  
  Any idea on how to fix this? My pytorch-lightning version is 1.5.10
answer: hey !
  this was removed in the previous release.
  You can try:
  trainer.validating = True
  trainer.reset_val_dataloader()
  trainer.val_loop.run()
  trainer.training = True