# Buggy code
def experiment(self) -> Experiment:
    r"""
    Actual Neptune object. To use neptune features in your
    :class:`~pytorch_lightning.core.lightning.LightningModule` do the following.

    Example::

        self.logger.experiment.some_neptune_function()

    """

    if self._experiment is None:
        self._experiment = neptune.create_experiment(
            name=self.experiment_name,
            params=self.params,
            properties=self.properties,
            tags=self.tags,
            upload_source_files=self.upload_source_files,
            **self._kwargs,
        )
    return self._experiment


# Traceback (Exception)
Traceback (most recent call last):
File "pl.py", line 146, in <module>
main()
File "pl.py", line 103, in main
trainer.fit(model)
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 751, in fit
mp.spawn(self.ddp_train, nprocs=self.num_processes, args=(model,))
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 200, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 158, in start_processes
while not context.join():
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 119, in join
raise Exception(msg)
Exception:

-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 20, in _wrap
fn(i, *args)
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_data_parallel.py", line 370, in ddp_train
self.run_pretrain_routine(model)
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 871, in run_pretrain_routine
self.configure_checkpoint_callback()
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/pytorch_lightning/trainer/callback_config.py", line 54, in configure_checkpoint_callback
self.logger.name,
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/pytorch_lightning/loggers/neptune.py", line 267, in name
return self.experiment.name
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/pytorch_lightning/loggers/neptune.py", line 230, in experiment
**self._kwargs)
File "/home/hirune/anaconda3/envs/PANDA/lib/python3.7/site-packages/neptune/__init__.py", line 222, in create_experiment
raise Uninitialized()
neptune.exceptions.Uninitialized: You must initialize neptune-client first. For more information, please visit: https://github.com/neptune-ai/neptune-client#initialize-neptune

# Fixed code
def experiment(self) -> Experiment:
    r"""
    Actual Neptune object. To use neptune features in your
    :class:`~pytorch_lightning.core.lightning.LightningModule` do the following.

    Example::

        self.logger.experiment.some_neptune_function()

    """

    # Note that even though we initialize self._experiment in __init__,
    # it may still end up being None after being pickled and un-pickled
    if self._experiment is None:
        self._experiment = self._create_or_get_experiment()

    return self._experiment