How do I test before any training?
❓ Questions and Help
I am now migrating some of my previous works into lightning. I wish to see if it is able to reproduce my previous results or not. But the doc implies that all the testing has to be performed after training or after loading the previous lightning training state, which I do not have either.
So How can I test before training?
Code
    trainer = Trainer(logger=logger, max_epochs=5, gpus=[3], distributed_backend=None)
    hparams = HParams(fold=fold, model=model_name, batch_size=8, num_workers=16)
    system = MySYS(hparams, trainer)

    system.model.load_state_dict(torch.load(state_dict))
    trainer.test()
It cannot work since the trainer does not initialize at all.
What have you tried?
I found inside the code for testing:
    def test(self, model=None):
        r"""

        Separates from fit to make sure you never run on your test set until you want to.

        Args:
            model (LightningModule): The model to test.

        Example::

            # Option 1
            # run test after fitting
            trainer = Trainer()
            model = LightningModule()

            trainer.fit()
            trainer.test()

            # Option 2
            # run test from a loaded model
            model = LightningModule.load_from_checkpoint('path/to/checkpoint.ckpt')
            trainer = Trainer()
            trainer.test(model)
        """
        self.testing = True
        if model is not None:
            self.fit(model)
        else:
            self.run_evaluation(test=True)
Which requires to fit the model that I do not understand at all. Why a fitting is required inside training code? If for the purpose of initialization, can't we just put some init code here?