AttributeError: 'LightningDataParallel' object has no attribute 'teardown'
🐛 Bug

To Reproduce
Steps to reproduce the behavior:
trainer = pytorch_lightning.Trainer(
    gpus=2,
    distributed_backend='dp'
)
model = BaseModel.load_from_checkpoint(...)
trainer.test(model)

Traceback (most recent call last):
File "run_kitti.py", line 351, in 
trainer.test(model)
File "/opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1198, in test
self.model.teardown('test')
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 594, in getattr
type(self).name, name))
AttributeError: 'LightningDataParallel' object has no attribute 'teardown'

Code sample

Expected behavior

Environment

CUDA:

GPU:

GeForce GTX 1080 Ti
GeForce GTX 1080 Ti


available:         True
version:           10.1


Packages:

numpy:             1.18.1
pyTorch_debug:     False
pyTorch_version:   1.5.1
pytorch-lightning: 0.8.1
tensorboard:       2.2.2
tqdm:              4.46.0


System:

OS:                Linux
architecture:

64bit



processor:         x86_64
python:            3.7.7
version:           #53~18.04.1-Ubuntu SMP Thu Jun 4 14:58:26 UTC 2020



Additional context

If I'm not missing something, this AttributeError is a bug on your side.