vfdev-5: Maybe, we can keep `self.experiment` such that we can have both API available ?
jakubczakon: Ok, I'll add it back.
jakubczakon: I think this fail on 3.6, pytorch is not my fault :(.
Could you re-run this @vfdev-5 ?
diff --git a/ignite/contrib/handlers/neptune_logger.py b/ignite/contrib/handlers/neptune_logger.py
index 10c2853a..abcda692 100644
--- a/ignite/contrib/handlers/neptune_logger.py
+++ b/ignite/contrib/handlers/neptune_logger.py
@@ -87,12 +87,12 @@ class OutputHandler(BaseOutputHandler):
                              event_name=Events.EPOCH_COMPLETED)
 
     Args:
-        tag (str): common title for all produced plots. For example, 'training'
+        tag (str): common title for all produced plots. For example, "training"
         metric_names (list of str, optional): list of metric names to plot or a string "all" to plot all available
             metrics.
         output_transform (callable, optional): output transform function to prepare `engine.state.output` as a number.
             For example, `output_transform = lambda output: output`
-            This function can also return a dictionary, e.g `{'loss': loss1, 'another_loss': loss2}` to label the plot
+            This function can also return a dictionary, e.g `{"loss": loss1, "another_loss": loss2}` to label the plot
             with corresponding keys.
         another_engine (Engine): Deprecated (see :attr:`global_step_transform`). Another engine to use to provide the
             value of event. Typically, user can provide
@@ -121,7 +121,7 @@ class OutputHandler(BaseOutputHandler):
     def __call__(self, engine, logger, event_name):
 
         if not isinstance(logger, NeptuneLogger):
-            raise RuntimeError("Handler 'OutputHandler' works only with NeptuneLogger")
+            raise RuntimeError("Handler OutputHandler works only with NeptuneLogger")
 
         metrics = self._setup_output_metrics(engine)
 
@@ -135,10 +135,10 @@ class OutputHandler(BaseOutputHandler):
 
         for key, value in metrics.items():
             if isinstance(value, numbers.Number) or isinstance(value, torch.Tensor) and value.ndimension() == 0:
-                logger.experiment.log_metric("{}/{}".format(self.tag, key), x=global_step, y=value)
+                logger.log_metric("{}/{}".format(self.tag, key), x=global_step, y=value)
             elif isinstance(value, torch.Tensor) and value.ndimension() == 1:
                 for i, v in enumerate(value):
-                    logger.experiment.log_metric("{}/{}/{}".format(self.tag, key, i), x=global_step, y=v.item())
+                    logger.log_metric("{}/{}/{}".format(self.tag, key, i), x=global_step, y=v.item())
             else:
                 warnings.warn("NeptuneLogger output_handler can not log " "metrics value type {}".format(type(value)))
 
@@ -170,7 +170,7 @@ class OptimizerParamsHandler(BaseOptimizerParamsHandler):
     Args:
         optimizer (torch.optim.Optimizer): torch optimizer which parameters to log
         param_name (str): parameter name
-        tag (str, optional): common title for all produced plots. For example, 'generator'
+        tag (str, optional): common title for all produced plots. For example, generator
     """
 
     def __init__(self, optimizer, param_name="lr", tag=None):
@@ -178,7 +178,7 @@ class OptimizerParamsHandler(BaseOptimizerParamsHandler):
 
     def __call__(self, engine, logger, event_name):
         if not isinstance(logger, NeptuneLogger):
-            raise RuntimeError("Handler 'OptimizerParamsHandler' works only with NeptuneLogger")
+            raise RuntimeError("Handler OptimizerParamsHandler works only with NeptuneLogger")
 
         global_step = engine.state.get_event_attrib_value(event_name)
         tag_prefix = "{}/".format(self.tag) if self.tag else ""
@@ -188,7 +188,7 @@ class OptimizerParamsHandler(BaseOptimizerParamsHandler):
         }
 
         for k, v in params.items():
-            logger.experiment.log_metric(k, x=global_step, y=v)
+            logger.log_metric(k, x=global_step, y=v)
 
 
 class WeightsScalarHandler(BaseWeightsScalarHandler):
@@ -220,7 +220,7 @@ class WeightsScalarHandler(BaseWeightsScalarHandler):
     Args:
         model (torch.nn.Module): model to log weights
         reduction (callable): function to reduce parameters into scalar
-        tag (str, optional): common title for all produced plots. For example, 'generator'
+        tag (str, optional): common title for all produced plots. For example, generator
 
     """
 
@@ -230,7 +230,7 @@ class WeightsScalarHandler(BaseWeightsScalarHandler):
     def __call__(self, engine, logger, event_name):
 
         if not isinstance(logger, NeptuneLogger):
-            raise RuntimeError("Handler 'WeightsScalarHandler' works only with NeptuneLogger")
+            raise RuntimeError("Handler WeightsScalarHandler works only with NeptuneLogger")
 
         global_step = engine.state.get_event_attrib_value(event_name)
         tag_prefix = "{}/".format(self.tag) if self.tag else ""
@@ -239,7 +239,7 @@ class WeightsScalarHandler(BaseWeightsScalarHandler):
                 continue
 
             name = name.replace(".", "/")
-            logger.experiment.log_metric(
+            logger.log_metric(
                 "{}weights_{}/{}".format(tag_prefix, self.reduction.__name__, name),
                 x=global_step,
                 y=self.reduction(p.data),
@@ -275,7 +275,7 @@ class GradsScalarHandler(BaseWeightsScalarHandler):
     Args:
         model (torch.nn.Module): model to log weights
         reduction (callable): function to reduce parameters into scalar
-        tag (str, optional): common title for all produced plots. For example, 'generator'
+        tag (str, optional): common title for all produced plots. For example, generator
 
     """
 
@@ -284,7 +284,7 @@ class GradsScalarHandler(BaseWeightsScalarHandler):
 
     def __call__(self, engine, logger, event_name):
         if not isinstance(logger, NeptuneLogger):
-            raise RuntimeError("Handler 'GradsScalarHandler' works only with NeptuneLogger")
+            raise RuntimeError("Handler GradsScalarHandler works only with NeptuneLogger")
 
         global_step = engine.state.get_event_attrib_value(event_name)
         tag_prefix = "{}/".format(self.tag) if self.tag else ""
@@ -293,7 +293,7 @@ class GradsScalarHandler(BaseWeightsScalarHandler):
                 continue
 
             name = name.replace(".", "/")
-            logger.experiment.log_metric(
+            logger.log_metric(
                 "{}grads_{}/{}".format(tag_prefix, self.reduction.__name__, name),
                 x=global_step,
                 y=self.reduction(p.grad),
@@ -354,7 +354,7 @@ class NeptuneLogger(BaseLogger):
 
             # Attach the logger to the trainer to log training loss at each iteration
             npt_logger.attach(trainer,
-                             log_handler=OutputHandler(tag="training", output_transform=lambda loss: {'loss': loss}),
+                             log_handler=OutputHandler(tag="training", output_transform=lambda loss: {"loss": loss}),
                              event_name=Events.ITERATION_COMPLETED)
 
             # Attach the logger to the evaluator on the training dataset and log NLL, Accuracy metrics after each epoch
@@ -397,11 +397,11 @@ class NeptuneLogger(BaseLogger):
             from ignite.handlers import Checkpoint
 
             def score_function(engine):
-                return engine.state.metrics['accuracy']
+                return engine.state.metrics["accuracy"]
 
-            to_save = {'model': model}
+            to_save = {"model": model}
             handler = Checkpoint(to_save, NeptuneSaver(npt_logger), n_saved=2,
-                                 filename_prefix='best', score_function=score_function,
+                                 filename_prefix="best", score_function=score_function,
                                  score_name="validation_accuracy",
                                  global_step_transform=global_step_from_engine(trainer))
             validation_evaluator.add_event_handler(Events.COMPLETED, handler)
@@ -425,11 +425,20 @@ class NeptuneLogger(BaseLogger):
                 # Attach the logger to the trainer to log training loss at each iteration
                 npt_logger.attach(trainer,
                                  log_handler=OutputHandler(tag="training",
-                                                           output_transform=lambda loss: {'loss': loss}),
+                                                           output_transform=lambda loss: {"loss": loss}),
                                  event_name=Events.ITERATION_COMPLETED)
 
     """
 
+    def __getattr__(self, attr):
+
+        import neptune
+
+        def wrapper(*args, **kwargs):
+            return getattr(neptune, attr)(*args, **kwargs)
+
+        return wrapper
+
     def __init__(self, *args, **kwargs):
         try:
             import neptune
@@ -444,8 +453,9 @@ class NeptuneLogger(BaseLogger):
             neptune.init(project_qualified_name="dry-run/project", backend=neptune.OfflineBackend())
         else:
             self.mode = "online"
-            neptune.init(api_token=kwargs["api_token"], project_qualified_name=kwargs["project_name"])
+            neptune.init(api_token=kwargs.get("api_token"), project_qualified_name=kwargs.get("project_name"))
 
+        kwargs["name"] = kwargs.pop("experiment_name", None)
         self._experiment_kwargs = {
             k: v for k, v in kwargs.items() if k not in ["api_token", "project_name", "offline_mode"]
         }
@@ -453,7 +463,7 @@ class NeptuneLogger(BaseLogger):
         self.experiment = neptune.create_experiment(**self._experiment_kwargs)
 
     def close(self):
-        self.experiment.stop()
+        self.stop()
 
 
 class NeptuneSaver:
@@ -486,20 +496,20 @@ class NeptuneSaver:
             from ignite.handlers import Checkpoint
 
             def score_function(engine):
-                return engine.state.metrics['accuracy']
+                return engine.state.metrics["accuracy"]
 
-            to_save = {'model': model}
+            to_save = {"model": model}
 
             # pass neptune logger to NeptuneServer
 
             handler = Checkpoint(to_save, NeptuneSaver(npt_logger), n_saved=2,
-                                 filename_prefix='best', score_function=score_function,
+                                 filename_prefix="best", score_function=score_function,
                                  score_name="validation_accuracy",
                                  global_step_transform=global_step_from_engine(trainer))
 
             evaluator.add_event_handler(Events.COMPLETED, handler)
 
-            # We need to close the logger when we are done
+        # We need to close the logger when we are done
             npt_logger.close()
 
     For example, you can access model checkpoints and download them from here:
@@ -508,13 +518,13 @@ class NeptuneSaver:
     """
 
     def __init__(self, neptune_logger: NeptuneLogger):
-        self._experiment = neptune_logger.experiment
+        self._logger = neptune_logger
 
     def __call__(self, checkpoint: Mapping, filename: str) -> None:
 
         with tempfile.NamedTemporaryFile() as tmp:
             torch.save(checkpoint, tmp.name)
-            self._experiment.log_artifact(tmp.name, filename)
+            self._logger.log_artifact(tmp.name, filename)
 
     def remove(self, filename: str) -> None:
-        self._experiment.delete_artifacts(filename)
+        self._logger.delete_artifacts(filename)

Unexpected keyword argument 'experiment_name' in Neptune logger
## 🐛 Bug description

I instantiate the logger as 
```python
npt_logger = npt_module.NeptuneLogger(
        api_token=api_token, 
        project_name="vfdev-5/my_project", 
        experiment_name="test",
        params=config
)
```
and I get the error
```
TypeError: create_experiment() got an unexpected keyword argument 'experiment_name'
```

@jakubczakon any ideas why it happens ?


## Environment

 - PyTorch Version (e.g., 1.4): 1.4
 - Ignite Version (e.g., 0.3.0): 0.4.0.dev20200418




diff --git a/tests/ignite/contrib/handlers/test_neptune_logger.py b/tests/ignite/contrib/handlers/test_neptune_logger.py
index 845adcb2..46f42ffd 100644
--- a/tests/ignite/contrib/handlers/test_neptune_logger.py
+++ b/tests/ignite/contrib/handlers/test_neptune_logger.py
@@ -18,7 +18,7 @@ def test_optimizer_params_handler_wrong_setup():
 
     mock_logger = MagicMock()
     mock_engine = MagicMock()
-    with pytest.raises(RuntimeError, match="Handler 'OptimizerParamsHandler' works only with NeptuneLogger"):
+    with pytest.raises(RuntimeError, match="Handler OptimizerParamsHandler works only with NeptuneLogger"):
         handler(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
 
@@ -26,20 +26,20 @@ def test_optimizer_params():
     optimizer = torch.optim.SGD([torch.Tensor(0)], lr=0.01)
     wrapper = OptimizerParamsHandler(optimizer=optimizer, param_name="lr")
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.iteration = 123
 
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
-    mock_logger.experiment.log_metric.assert_called_once_with("lr/group_0", y=0.01, x=123)
+    mock_logger.log_metric.assert_called_once_with("lr/group_0", y=0.01, x=123)
 
     wrapper = OptimizerParamsHandler(optimizer, param_name="lr", tag="generator")
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
+    mock_logger.log_metric = MagicMock()
 
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
-    mock_logger.experiment.log_metric.assert_called_once_with("generator/lr/group_0", y=0.01, x=123)
+    mock_logger.log_metric.assert_called_once_with("generator/lr/group_0", y=0.01, x=123)
 
 
 def test_output_handler_with_wrong_logger_type():
@@ -47,61 +47,56 @@ def test_output_handler_with_wrong_logger_type():
 
     mock_logger = MagicMock()
     mock_engine = MagicMock()
-    with pytest.raises(RuntimeError, match="Handler 'OutputHandler' works only with NeptuneLogger"):
+    with pytest.raises(RuntimeError, match="Handler OutputHandler works only with NeptuneLogger"):
         wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
 
 def test_output_handler_output_transform():
     wrapper = OutputHandler("tag", output_transform=lambda x: x)
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.output = 12345
     mock_engine.state.iteration = 123
 
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
-
-    mock_logger.experiment.log_metric.assert_called_once_with("tag/output", y=12345, x=123)
+    mock_logger.log_metric.assert_called_once_with("tag/output", y=12345, x=123)
 
     wrapper = OutputHandler("another_tag", output_transform=lambda x: {"loss": x})
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
+    mock_logger.log_metric = MagicMock()
 
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
-    mock_logger.experiment.log_metric.assert_called_once_with("another_tag/loss", y=12345, x=123)
+    mock_logger.log_metric.assert_called_once_with("another_tag/loss", y=12345, x=123)
 
 
 def test_output_handler_metric_names():
     wrapper = OutputHandler("tag", metric_names=["a", "b"])
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State(metrics={"a": 12.23, "b": 23.45})
     mock_engine.state.iteration = 5
 
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
-    assert mock_logger.experiment.log_metric.call_count == 2
-    mock_logger.experiment.log_metric.assert_has_calls(
-        [call("tag/a", y=12.23, x=5), call("tag/b", y=23.45, x=5),], any_order=True
-    )
+    assert mock_logger.log_metric.call_count == 2
+    mock_logger.log_metric.assert_has_calls([call("tag/a", y=12.23, x=5), call("tag/b", y=23.45, x=5),], any_order=True)
 
     wrapper = OutputHandler("tag", metric_names=["a",])
 
     mock_engine = MagicMock()
+    mock_logger.log_metric = MagicMock()
     mock_engine.state = State(metrics={"a": torch.Tensor([0.0, 1.0, 2.0, 3.0])})
     mock_engine.state.iteration = 5
 
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
-    assert mock_logger.experiment.log_metric.call_count == 4
-    mock_logger.experiment.log_metric.assert_has_calls(
+    assert mock_logger.log_metric.call_count == 4
+    mock_logger.log_metric.assert_has_calls(
         [
             call("tag/a/0", y=0.0, x=5),
             call("tag/a/1", y=1.0, x=5),
@@ -114,40 +109,37 @@ def test_output_handler_metric_names():
     wrapper = OutputHandler("tag", metric_names=["a", "c"])
 
     mock_engine = MagicMock()
+    mock_logger.log_metric = MagicMock()
     mock_engine.state = State(metrics={"a": 55.56, "c": "Some text"})
     mock_engine.state.iteration = 7
 
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
+    mock_logger.log_metric = MagicMock()
 
     with pytest.warns(UserWarning):
         wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
-    assert mock_logger.experiment.log_metric.call_count == 1
-    mock_logger.experiment.log_metric.assert_has_calls([call("tag/a", y=55.56, x=7),], any_order=True)
+    assert mock_logger.log_metric.call_count == 1
+    mock_logger.log_metric.assert_has_calls([call("tag/a", y=55.56, x=7),], any_order=True)
 
     # all metrics
     wrapper = OutputHandler("tag", metric_names="all")
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State(metrics={"a": 12.23, "b": 23.45})
     mock_engine.state.iteration = 5
 
     wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
-    assert mock_logger.experiment.log_metric.call_count == 2
-    mock_logger.experiment.log_metric.assert_has_calls(
-        [call("tag/a", y=12.23, x=5), call("tag/b", y=23.45, x=5),], any_order=True
-    )
+    assert mock_logger.log_metric.call_count == 2
+    mock_logger.log_metric.assert_has_calls([call("tag/a", y=12.23, x=5), call("tag/b", y=23.45, x=5),], any_order=True)
 
 
 def test_output_handler_both():
     wrapper = OutputHandler("tag", metric_names=["a", "b"], output_transform=lambda x: {"loss": x})
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State(metrics={"a": 12.23, "b": 23.45})
     mock_engine.state.epoch = 5
@@ -155,8 +147,8 @@ def test_output_handler_both():
 
     wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED)
 
-    assert mock_logger.experiment.log_metric.call_count == 3
-    mock_logger.experiment.log_metric.assert_has_calls(
+    assert mock_logger.log_metric.call_count == 3
+    mock_logger.log_metric.assert_has_calls(
         [call("tag/a", y=12.23, x=5), call("tag/b", y=23.45, x=5), call("tag/loss", y=12345, x=5)], any_order=True
     )
 
@@ -167,8 +159,6 @@ def test_output_handler_with_wrong_global_step_transform_output():
 
     wrapper = OutputHandler("tag", output_transform=lambda x: {"loss": x}, global_step_transform=global_step_transform)
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.epoch = 5
@@ -191,16 +181,15 @@ def test_output_handler_with_global_step_from_engine():
     )
 
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.epoch = 1
     mock_engine.state.output = 0.123
 
     wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED)
-    assert mock_logger.experiment.log_metric.call_count == 1
-    mock_logger.experiment.log_metric.assert_has_calls(
+    assert mock_logger.log_metric.call_count == 1
+    mock_logger.log_metric.assert_has_calls(
         [call("tag/loss", y=mock_engine.state.output, x=mock_another_engine.state.epoch)]
     )
 
@@ -208,8 +197,8 @@ def test_output_handler_with_global_step_from_engine():
     mock_engine.state.output = 1.123
 
     wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED)
-    assert mock_logger.experiment.log_metric.call_count == 2
-    mock_logger.experiment.log_metric.assert_has_calls(
+    assert mock_logger.log_metric.call_count == 2
+    mock_logger.log_metric.assert_has_calls(
         [call("tag/loss", y=mock_engine.state.output, x=mock_another_engine.state.epoch)]
     )
 
@@ -220,16 +209,15 @@ def test_output_handler_with_global_step_transform():
 
     wrapper = OutputHandler("tag", output_transform=lambda x: {"loss": x}, global_step_transform=global_step_transform)
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.epoch = 5
     mock_engine.state.output = 12345
 
     wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED)
-    assert mock_logger.experiment.log_metric.call_count == 1
-    mock_logger.experiment.log_metric.assert_has_calls([call("tag/loss", y=12345, x=10)])
+    assert mock_logger.log_metric.call_count == 1
+    mock_logger.log_metric.assert_has_calls([call("tag/loss", y=12345, x=10)])
 
 
 def test_weights_scalar_handler_wrong_setup():
@@ -246,7 +234,7 @@ def test_weights_scalar_handler_wrong_setup():
     wrapper = WeightsScalarHandler(model)
     mock_logger = MagicMock()
     mock_engine = MagicMock()
-    with pytest.raises(RuntimeError, match="Handler 'WeightsScalarHandler' works only with NeptuneLogger"):
+    with pytest.raises(RuntimeError, match="Handler WeightsScalarHandler works only with NeptuneLogger"):
         wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
 
@@ -257,8 +245,7 @@ def test_weights_scalar_handler(dummy_model_factory):
     def _test(tag=None):
         wrapper = WeightsScalarHandler(model, tag=tag)
         mock_logger = MagicMock(spec=NeptuneLogger)
-        mock_logger.experiment = MagicMock()
-
+        mock_logger.log_metric = MagicMock()
         mock_engine = MagicMock()
         mock_engine.state = State()
         mock_engine.state.epoch = 5
@@ -267,8 +254,8 @@ def test_weights_scalar_handler(dummy_model_factory):
 
         tag_prefix = "{}/".format(tag) if tag else ""
 
-        assert mock_logger.experiment.log_metric.call_count == 4
-        mock_logger.experiment.log_metric.assert_has_calls(
+        assert mock_logger.log_metric.call_count == 4
+        mock_logger.log_metric.assert_has_calls(
             [
                 call(tag_prefix + "weights_norm/fc1/weight", y=0.0, x=5),
                 call(tag_prefix + "weights_norm/fc1/bias", y=0.0, x=5),
@@ -287,26 +274,25 @@ def test_weights_scalar_handler_frozen_layers(dummy_model_factory):
 
     wrapper = WeightsScalarHandler(model)
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.epoch = 5
 
     wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED)
 
-    mock_logger.experiment.log_metric.assert_has_calls(
+    mock_logger.log_metric.assert_has_calls(
         [call("weights_norm/fc2/weight", y=12.0, x=5), call("weights_norm/fc2/bias", y=math.sqrt(12.0), x=5),],
         any_order=True,
     )
 
     with pytest.raises(AssertionError):
-        mock_logger.experiment.log_metric.assert_has_calls(
+        mock_logger.log_metric.assert_has_calls(
             [call("weights_norm/fc1/weight", y=12.0, x=5), call("weights_norm/fc1/bias", y=math.sqrt(12.0), x=5),],
             any_order=True,
         )
 
-    assert mock_logger.experiment.log_metric.call_count == 2
+    assert mock_logger.log_metric.call_count == 2
 
 
 def test_grads_scalar_handler_wrong_setup():
@@ -320,7 +306,7 @@ def test_grads_scalar_handler_wrong_setup():
     wrapper = GradsScalarHandler(model)
     mock_logger = MagicMock()
     mock_engine = MagicMock()
-    with pytest.raises(RuntimeError, match="Handler 'GradsScalarHandler' works only with NeptuneLogger"):
+    with pytest.raises(RuntimeError, match="Handler GradsScalarHandler works only with NeptuneLogger"):
         wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
 
 
@@ -331,8 +317,7 @@ def test_grads_scalar_handler(dummy_model_factory, norm_mock):
     def _test(tag=None):
         wrapper = GradsScalarHandler(model, reduction=norm_mock, tag=tag)
         mock_logger = MagicMock(spec=NeptuneLogger)
-        mock_logger.experiment = MagicMock()
-
+        mock_logger.log_metric = MagicMock()
         mock_engine = MagicMock()
         mock_engine.state = State()
         mock_engine.state.epoch = 5
@@ -342,7 +327,7 @@ def test_grads_scalar_handler(dummy_model_factory, norm_mock):
 
         tag_prefix = "{}/".format(tag) if tag else ""
 
-        mock_logger.experiment.log_metric.assert_has_calls(
+        mock_logger.log_metric.assert_has_calls(
             [
                 call(tag_prefix + "grads_norm/fc1/weight", y=ANY, x=5),
                 call(tag_prefix + "grads_norm/fc1/bias", y=ANY, x=5),
@@ -351,7 +336,7 @@ def test_grads_scalar_handler(dummy_model_factory, norm_mock):
             ],
             any_order=True,
         )
-        assert mock_logger.experiment.log_metric.call_count == 4
+        assert mock_logger.log_metric.call_count == 4
         assert norm_mock.call_count == 4
 
     _test()
@@ -363,8 +348,7 @@ def test_grads_scalar_handler_frozen_layers(dummy_model_factory, norm_mock):
 
     wrapper = GradsScalarHandler(model, reduction=norm_mock)
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_metric = MagicMock()
     mock_engine = MagicMock()
     mock_engine.state = State()
     mock_engine.state.epoch = 5
@@ -372,15 +356,15 @@ def test_grads_scalar_handler_frozen_layers(dummy_model_factory, norm_mock):
 
     wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED)
 
-    mock_logger.experiment.log_metric.assert_has_calls(
+    mock_logger.log_metric.assert_has_calls(
         [call("grads_norm/fc2/weight", y=ANY, x=5), call("grads_norm/fc2/bias", y=ANY, x=5),], any_order=True
     )
 
     with pytest.raises(AssertionError):
-        mock_logger.experiment.log_metric.assert_has_calls(
+        mock_logger.log_metric.assert_has_calls(
             [call("grads_norm/fc1/weight", y=ANY, x=5), call("grads_norm/fc1/bias", y=ANY, x=5),], any_order=True
         )
-    assert mock_logger.experiment.log_metric.call_count == 2
+    assert mock_logger.log_metric.call_count == 2
     assert norm_mock.call_count == 2
 
 
@@ -400,7 +384,7 @@ def test_integration():
 
     def dummy_handler(engine, logger, event_name):
         global_step = engine.state.get_event_attrib_value(event_name)
-        logger.experiment.log_metric("test_value", global_step, global_step)
+        logger.log_metric("test_value", global_step, global_step)
 
     npt_logger.attach(trainer, log_handler=dummy_handler, event_name=Events.EPOCH_COMPLETED)
 
@@ -423,7 +407,7 @@ def test_integration_as_context_manager():
 
         def dummy_handler(engine, logger, event_name):
             global_step = engine.state.get_event_attrib_value(event_name)
-            logger.experiment.log_metric("test_value", global_step, global_step)
+            logger.log_metric("test_value", global_step, global_step)
 
         npt_logger.attach(trainer, log_handler=dummy_handler, event_name=Events.EPOCH_COMPLETED)
 
@@ -433,8 +417,7 @@ def test_integration_as_context_manager():
 def test_neptune_saver_serializable(dummy_model_factory, dirname):
 
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
-
+    mock_logger.log_artifact = MagicMock()
     model = torch.nn.Module()
     to_save_serializable = {"model": model}
 
@@ -442,13 +425,13 @@ def test_neptune_saver_serializable(dummy_model_factory, dirname):
     fname = "test.pt"
     saver(to_save_serializable, fname)
 
-    assert mock_logger.experiment.log_artifact.call_count == 1
+    assert mock_logger.log_artifact.call_count == 1
 
 
 def test_neptune_saver_non_serializable(dirname):
 
     mock_logger = MagicMock(spec=NeptuneLogger)
-    mock_logger.experiment = MagicMock()
+    mock_logger.log_artifact = MagicMock()
 
     to_save_non_serializable = {"model": lambda x: x}
 
@@ -463,7 +446,7 @@ def test_neptune_saver_non_serializable(dirname):
     except Exception:
         pass
 
-    assert mock_logger.experiment.log_artifact.call_count == 0
+    assert mock_logger.log_artifact.call_count == 0
 
 
 @pytest.fixture

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc pip install torch torchvision -f https://download.pytorch.org/whl/cpu/torch_stable.html -U
3.7
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
absl-py==2.1.0
alembic==1.12.1
arrow==1.2.3
attrs==24.2.0
boto3==1.33.13
botocore==1.33.13
bravado==11.1.0
bravado-core==6.1.1
cached-property==1.5.2
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
click==7.1.2
cloudpickle==2.2.1
codecov==2.1.13
coverage==7.2.7
cycler==0.11.0
databricks-cli==0.18.0
dill==0.3.7
docker==6.1.3
entrypoints==0.4
exceptiongroup==1.2.2
execnet==2.0.2
Flask==1.1.4
fonttools==4.38.0
fqdn==1.5.1
future==1.0.0
gitdb==4.0.12
GitPython==3.1.44
google-auth==2.38.0
google-auth-oauthlib==0.4.6
greenlet==3.1.1
grpcio==1.62.3
gunicorn==20.1.0
gym==0.26.2
gym-notices==0.0.8
hestia==0.6.0
idna==3.10
importlib-metadata==5.2.0
importlib-resources==5.12.0
iniconfig==2.0.0
isoduration==20.11.0
itsdangerous==1.1.0
Jinja2==2.10.3
jmespath==1.0.1
joblib==1.3.2
jsonpatch==1.33
jsonpointer==3.0.0
jsonref==1.1.0
jsonschema==4.17.3
kiwisolver==1.4.5
Mako==1.2.4
Markdown==3.4.4
MarkupSafe==2.1.5
marshmallow==3.0.0rc5
matplotlib==3.5.3
mlflow==1.30.1
monotonic==1.6
msgpack==1.0.5
neptune-client==1.11.1
networkx==2.6.3
numpy==1.21.6
oauthlib==3.2.2
packaging==21.3
pandas==1.3.5
Pillow==9.5.0
pkgutil_resolve_name==1.3.10
pluggy==1.2.0
polyaxon-client==0.6.1
polyaxon-schemas==0.6.1
polystores==0.2.5
prometheus-client==0.17.1
prometheus_flask_exporter==0.23.2
protobuf==3.20.3
psutil==7.0.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
PyJWT==2.8.0
pynvml==11.5.3
pyparsing==3.1.4
pyrsistent==0.19.3
pytest==7.4.4
pytest-cov==4.1.0
pytest-xdist==3.5.0
python-dateutil==2.9.0.post0
-e git+https://github.com/pytorch/ignite.git@29058e2f0e7d753cbd8dbb254652288afa81bda0#egg=pytorch_ignite
pytz==2022.7.1
PyYAML==6.0.1
querystring-parser==1.2.4
requests==2.31.0
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rhea==0.5.5
rsa==4.9
s3transfer==0.8.2
scikit-learn==1.0.2
scipy==1.7.3
simplejson==3.20.1
six==1.17.0
smmap==5.0.2
SQLAlchemy==1.4.54
sqlparse==0.4.4
swagger-spec-validator==3.0.3
tabulate==0.9.0
tensorboard==2.11.2
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorboardX==2.6.2.2
threadpoolctl==3.1.0
tomli==2.0.1
torch==1.13.1+cpu
torchvision==0.14.1+cpu
tornado==6.2
tqdm==4.67.1
typing_extensions==4.7.1
uri-template==1.3.0
urllib3==1.26.20
visdom==0.2.4
webcolors==1.13
websocket-client==1.6.1
Werkzeug==1.0.1
zipp==3.15.0

name: ignite
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - absl-py==2.1.0
      - alembic==1.12.1
      - arrow==1.2.3
      - attrs==24.2.0
      - boto3==1.33.13
      - botocore==1.33.13
      - bravado==11.1.0
      - bravado-core==6.1.1
      - cached-property==1.5.2
      - cachetools==5.5.2
      - charset-normalizer==3.4.1
      - click==7.1.2
      - cloudpickle==2.2.1
      - codecov==2.1.13
      - coverage==7.2.7
      - cycler==0.11.0
      - databricks-cli==0.18.0
      - dill==0.3.7
      - docker==6.1.3
      - entrypoints==0.4
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - flask==1.1.4
      - fonttools==4.38.0
      - fqdn==1.5.1
      - future==1.0.0
      - gitdb==4.0.12
      - gitpython==3.1.44
      - google-auth==2.38.0
      - google-auth-oauthlib==0.4.6
      - greenlet==3.1.1
      - grpcio==1.62.3
      - gunicorn==20.1.0
      - gym==0.26.2
      - gym-notices==0.0.8
      - hestia==0.6.0
      - idna==3.10
      - importlib-metadata==5.2.0
      - importlib-resources==5.12.0
      - iniconfig==2.0.0
      - isoduration==20.11.0
      - itsdangerous==1.1.0
      - jinja2==2.10.3
      - jmespath==1.0.1
      - joblib==1.3.2
      - jsonpatch==1.33
      - jsonpointer==3.0.0
      - jsonref==1.1.0
      - jsonschema==4.17.3
      - kiwisolver==1.4.5
      - mako==1.2.4
      - markdown==3.4.4
      - markupsafe==2.1.5
      - marshmallow==3.0.0rc5
      - matplotlib==3.5.3
      - mlflow==1.30.1
      - monotonic==1.6
      - msgpack==1.0.5
      - neptune-client==1.11.1
      - networkx==2.6.3
      - numpy==1.21.6
      - oauthlib==3.2.2
      - packaging==21.3
      - pandas==1.3.5
      - pillow==9.5.0
      - pkgutil-resolve-name==1.3.10
      - pluggy==1.2.0
      - polyaxon-client==0.6.1
      - polyaxon-schemas==0.6.1
      - polystores==0.2.5
      - prometheus-client==0.17.1
      - prometheus-flask-exporter==0.23.2
      - protobuf==3.20.3
      - psutil==7.0.0
      - pyasn1==0.5.1
      - pyasn1-modules==0.3.0
      - pyjwt==2.8.0
      - pynvml==11.5.3
      - pyparsing==3.1.4
      - pyrsistent==0.19.3
      - pytest==7.4.4
      - pytest-cov==4.1.0
      - pytest-xdist==3.5.0
      - python-dateutil==2.9.0.post0
      - pytorch-ignite==0.4.0
      - pytz==2022.7.1
      - pyyaml==6.0.1
      - querystring-parser==1.2.4
      - requests==2.31.0
      - requests-oauthlib==2.0.0
      - requests-toolbelt==1.0.0
      - rfc3339-validator==0.1.4
      - rfc3986-validator==0.1.1
      - rhea==0.5.5
      - rsa==4.9
      - s3transfer==0.8.2
      - scikit-learn==1.0.2
      - scipy==1.7.3
      - simplejson==3.20.1
      - six==1.17.0
      - smmap==5.0.2
      - sqlalchemy==1.4.54
      - sqlparse==0.4.4
      - swagger-spec-validator==3.0.3
      - tabulate==0.9.0
      - tensorboard==2.11.2
      - tensorboard-data-server==0.6.1
      - tensorboard-plugin-wit==1.8.1
      - tensorboardx==2.6.2.2
      - threadpoolctl==3.1.0
      - tomli==2.0.1
      - torch==1.13.1+cpu
      - torchvision==0.14.1+cpu
      - tornado==6.2
      - tqdm==4.67.1
      - typing-extensions==4.7.1
      - uri-template==1.3.0
      - urllib3==1.26.20
      - visdom==0.2.4
      - webcolors==1.13
      - websocket-client==1.6.1
      - werkzeug==1.0.1
      - zipp==3.15.0
prefix: /opt/conda/envs/ignite

tests/ignite/contrib/handlers/test_neptune_logger.py::test_optimizer_params_handler_wrong_setup tests/ignite/contrib/handlers/test_neptune_logger.py::test_optimizer_params tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_with_wrong_logger_type tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_output_transform tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_metric_names tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_both tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_with_global_step_from_engine tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_with_global_step_transform tests/ignite/contrib/handlers/test_neptune_logger.py::test_weights_scalar_handler_wrong_setup tests/ignite/contrib/handlers/test_neptune_logger.py::test_weights_scalar_handler tests/ignite/contrib/handlers/test_neptune_logger.py::test_weights_scalar_handler_frozen_layers tests/ignite/contrib/handlers/test_neptune_logger.py::test_grads_scalar_handler_wrong_setup tests/ignite/contrib/handlers/test_neptune_logger.py::test_grads_scalar_handler tests/ignite/contrib/handlers/test_neptune_logger.py::test_grads_scalar_handler_frozen_layers tests/ignite/contrib/handlers/test_neptune_logger.py::test_neptune_saver_serializable tests/ignite/contrib/handlers/test_neptune_logger.py::test_neptune_saver_non_serializable
tests/ignite/contrib/handlers/test_neptune_logger.py::test_integration tests/ignite/contrib/handlers/test_neptune_logger.py::test_integration_as_context_manager
tests/ignite/contrib/handlers/test_neptune_logger.py::test_output_handler_with_wrong_global_step_transform_output tests/ignite/contrib/handlers/test_neptune_logger.py::test_no_neptune_client
ignite/contrib/handlers/neptune_logger.py
ignite/contrib/handlers/neptune_logger.py