LightningModule with yacs CfgNode in __init__ will failed with some training settings
What is your question?
My custom LightningModule has a yacs.config.CfgNode parameter in its __init__:
from yacs.config import CfgNode

class MyModule(pl.LightningModule):
    def __init__(self, cfg: CfgNode):
        super(MyModule, self).__init__()
        self.cfg = cfg
        ...
When I use auto_lr_find=True  in the Trainer, the following error occur:
model = MyModule(cfg)
trainer = Trainer(gpus=1, auto_lr_find=True, ...)
trainer.fit(model)
  File "tools/train.py", line 95, in <module>
    trainer.fit(model)
  File ".../lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 792, in fit
    self._run_lr_finder_internally(model)
  File ".../lib/python3.7/site-packages/pytorch_lightning/trainer/lr_finder.py", line 31, in _run_lr_finder_internally
    lr_finder = self.lr_find(model)
  File ".../lib/python3.7/site-packages/pytorch_lightning/trainer/lr_finder.py", line 169, in lr_find
    self.restore(str(save_path), on_gpu=self.on_gpu)
  File ".../lib/python3.7/site-packages/pytorch_lightning/trainer/training_io.py", line 288, in restore
    checkpoint = torch.load(checkpoint_path, map_location=lambda storage, loc: storage)
  File ".../lib/python3.7/site-packages/torch/serialization.py", line 529, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File ".../lib/python3.7/site-packages/torch/serialization.py", line 702, in _legacy_load
    result = unpickler.load()
TypeError: __init__() takes 1 positional argument but 2 were given

Similar errors also happened when I use multi-gpu training:
trainer = Trainer(gpus=4, distributed_backend='ddp', ...)

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/conda/lib/python3.7/multiprocessing/spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "/opt/conda/lib/python3.7/multiprocessing/spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
TypeError: __init__() takes 1 positional argument but 2 were given

Training with one gpu and not using the above settings can run normally.
Another weird behavior is that when check_val_every_n_epoch > 1, trainer does not act properly, some time no validation is run and no checkpoint is saved. But setting check_val_every_n_epoch=1 will cost too much time.
What's your environment?

OS: [Linux]
Packaging [pip]
Version [pytorch=1.4, pytorch-lightning=0.7.5]