How to perform inference using saved model checkpoint
In the pl docs its shows how to run inference using a saved model "Test pre-trained model":
https://pytorch-lightning.readthedocs.io/en/latest/test_set.html#test-pre-trained-model
The example indicates we need to load a hparams file, while I have found to be correct - when a hparms file is not supplied args from argparser created at run start are not passed through the code. However when a yaml version of the args used in argparser for training, the resultant hparms in code is a dict not a Namespace and as such we cant use object . properties to access parameters.
pseudocode:
    class MyModel(pl.LightningModule):
        def __init__(self, args):
            super(MyModel, self).__init__()
            self.args=args
            ....

    model = create_model(args)
    trainer = Trainer(
        logger=setup_testube_logger(args),
        ...
    trainer.fit(model)

After trained:
        model = model.load_from_checkpoint(
                checkpoint_path=best.ckpt',
                hparams_file='configs/run_01.yaml' #same params as args
        )
        trainer = Trainer(
        logger=setup_testube_logger(args),
        ...
       trainer.test(model)

If hparams is not supplied then accessing eg args.some_parameter fails as args is empty. If hparams is supplied as yaml fiel then args is a dict that must be accessed as args['some_parmeter'] - which to get around only way I can see is write a check eg
if isinstance (args, dict):
    #we are loading model from checkpoint for inference, access args like args['some_parameter']
else:
    #we are trainig and can access args.some_parmeter

Or am I doing something wrongly?