[hparams] support haparms and params in the init
🐛 Bug
Gives TypeError while running on Google Colab TPU
To Reproduce
Steps to reproduce the behavior:
https://colab.research.google.com/drive/1K5i4kXzZCvbq3jc8IHPD_bd_EdUSjFml?usp=sharing
running trainer.fit(model) on TPU

TypeError                                 Traceback (most recent call last)
 in ()
21                       )
22
---> 23   trainer.fit(model)
3 frames
/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/trainer.py in fit(self, model, train_dataloader, val_dataloaders)
872
873             # load weights if not interrupted
--> 874             self.load_spawn_weights(model)
875             self.model = model
876
/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/distrib_data_parallel.py in load_spawn_weights(self, original_model)
415             # load weights saved in ddp
416             path = os.path.join(self.default_root_dir, '__temp_weight_ddp_end.ckpt')
--> 417             loaded_model = original_model.class.load_from_checkpoint(path)
418
419             # copy loaded weights to old model
/usr/local/lib/python3.6/dist-packages/pytorch_lightning/core/lightning.py in load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, tags_csv, hparam_overrides, *args, **kwargs)
1596             update_hparams(hparams, hparam_overrides)
1597
-> 1598         model = cls._load_model_state(checkpoint, *args, **kwargs)
1599         return model
1600
/usr/local/lib/python3.6/dist-packages/pytorch_lightning/core/lightning.py in _load_model_state(cls, checkpoint, *args, **kwargs)
1630         if cls_takes_hparams:
1631             kwargs.update(hparams=hparams)
-> 1632         model = cls(*args, **kwargs)
1633         model.load_state_dict(checkpoint['state_dict'])
1634
TypeError: init() missing 3 required positional arguments: 'df_train', 'df_test', and 'fold'
Code sample

Expected behavior
I am trying implement 5-fold CV and expected it to proceed to the next fold normally.
Environment
Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).
You can get the script and run it with:
wget https://raw.githubusercontent.com/PyTorchLightning/pytorch-lightning/master/tests/collect_env_details.py
# For security purposes, please check the contents of collect_env_details.py before running it.
python collect_env_details.py


CUDA:

GPU:
available:         False
version:           None


Packages:

numpy:             1.18.5
pyTorch_debug:     False
pyTorch_version:   1.6.0a0+541814f
pytorch-lightning: 0.7.6
tensorboard:       2.2.2
tqdm:              4.41.1


System:

OS:                Linux
architecture:

64bit



processor:         x86_64
python:            3.6.9
version:           #1 SMP Wed Feb 19 05:26:34 PST 2020



Additional context
Running on Google Colab TPU