'bad value(s) in fds_to_keep' error in DDP mode
🐛 Bug

To Reproduce
if i put spectral_norm in the model, it will output the error msg "bad value(s) in fds_to_keep"
event the example provided by pytorch-lightning have this kind of issue.
Steps to reproduce the behavior:
change the example model lightning_template.py: to
   ` self.c_d1 = nn.Linear(in_features=self.hparams.in_features,
                          out_features=self.hparams.hidden_dim) 

    self.c_d1 = spectral_norm(self.c_d1) 

    self.c_d1_bn = nn.BatchNorm1d(self.hparams.hidden_dim) 

    self.c_d1_drop = nn.Dropout(self.hparams.drop_prob) 

    self.c_d2 = nn.Linear(in_features=self.hparams.hidden_dim,
                          out_features=self.hparams.out_features)  

    self.c_d2 = spectral_norm(self.c_d2) `

run the example with
python3 gpu_template.py --gpus 2 --distributed_backend ddp
we will get error msg
Traceback (most recent call last): File "gpu_template.py", line 80, in <module> main(hyperparams) File "gpu_template.py", line 41, in main trainer.fit(model) File "/usr/local/lib/python3.6/dist-packages/pytorch_lightning/trainer/trainer.py", line 692, in fit mp.spawn(self.ddp_train, nprocs=self.num_gpus, args=(model,)) File "/usr/local/lib/python3.6/dist-packages/torch/multiprocessing/spawn.py", line 162, in spawn process.start() File "/usr/lib/python3.6/multiprocessing/process.py", line 105, in start self._popen = self._Popen(self) File "/usr/lib/python3.6/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/usr/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/usr/lib/python3.6/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 59, in _launch cmd, self._fds) File "/usr/lib/python3.6/multiprocessing/util.py", line 417, in spawnv_passfds False, False, None) ValueError: bad value(s) in fds_to_keep

Environment

CUDA:

GPU:

Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB
Tesla V100-SXM2-32GB


available:         True
version:           10.1


Packages:

numpy:             1.18.2
pyTorch_debug:     False
pyTorch_version:   1.4.0
pytorch-lightning: 0.7.3
tensorboard:       2.2.0
tqdm:              4.45.0


System:

OS:                Linux
architecture:

64bit
ELF


processor:         x86_64
python:            3.6.9
version:           #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019