Repository: pytorch/ignite

Issue:
Drop TrainsLogger and TrainsSaver
I suggest to drop all ClearML/Trains backward compatibility as ClearML is v1.X since 1.5 year and no one should be using trains v0.16 (the last version of trains).

Let's do the following:
- [ ] remove TrainsLogger, TrainsSaver code and tests
- [ ] remove all trains package backward compatility. For example, https://github.com/pytorch/ignite/blob/4bdf243dca5fb35134c7f7db551f7fac43f639f8/ignite/contrib/handlers/clearml_logger.py#L118-L121


Discussion:
I'd like to do it if no one else wants.
@louis-she let's keep this for new comers :) this is too simple for you

@vfdev-5  I would like to take this.
@soma2000-lang any blockers from your side to send a PR to solve this issue ?
I haven't  starred working on it yet ,will start soon

On Wed, 12 Oct 2022, 15:49 vfdev, ***@***.***> wrote:

> @soma2000-lang <https://github.com/soma2000-lang> any blockers from your
> side to send a PR to solve this issue ?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/pytorch/ignite/issues/2740#issuecomment-1275933601>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ANLS36P3DUMBMZOPZJZWYBTWC2GENANCNFSM6AAAAAARA3L5KM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>

@vfdev-5 Hi! I would like to contribute to this issue asap, just wanted to clarify one thing. Do we need to drop TrainsSaver and Logger completely or is there an alternative we need to use(maybe something like clearml)?
@harry7337  I am working on it already
> @harry7337  I am working on it already

@soma2000-lang I'll let you carry on then, good luck!
@soma2000-lang please send a PR in following days.

@harry7337 we have other help wanted issues, please take another one 👍 
@soma2000-lang please communicate when you will be able to send a draft PR with a fix for this issue ? 
@vfdev-5  I could not find any Trainslogger and TrainsSaver test file here.Also I am unable to find the TrainsSaver  file which  needs to be removed.
Try to search for TrainsLogger: https://github.com/pytorch/ignite/search?q=TrainsLogger

May I ask whether you understand what we need to do to fix this issue ?
@vfdev-5 

If I have understood the issue correctly then I  have to


1.Completely remove the TrainsLogger.py file(ignite/contrib/handlers/trains_logger.py](https://github.com/pytorch/ignite/blob/9230a7319047b37ce19d956e024fa1b86030c30a/ignite/contrib/handlers/trains_logger.py)
and all  the places where the code of TrainsLogger and TrainsSaver has been used

2.Remove the backward comaptibility  code for the trains package.



Seems correct, please go ahead with this plan

Resolving patch:
diff --git a/ignite/contrib/handlers/__init__.py b/ignite/contrib/handlers/__init__.py
--- a/ignite/contrib/handlers/__init__.py
+++ b/ignite/contrib/handlers/__init__.py
@@ -4,7 +4,7 @@
 from ignite.contrib.handlers.polyaxon_logger import PolyaxonLogger
 from ignite.contrib.handlers.tensorboard_logger import TensorboardLogger
 from ignite.contrib.handlers.tqdm_logger import ProgressBar
-from ignite.contrib.handlers.trains_logger import TrainsLogger
+
 from ignite.contrib.handlers.visdom_logger import VisdomLogger
 from ignite.contrib.handlers.wandb_logger import WandBLogger
 from ignite.handlers import EpochOutputStore, global_step_from_engine  # ref  # ref
diff --git a/ignite/contrib/handlers/clearml_logger.py b/ignite/contrib/handlers/clearml_logger.py
--- a/ignite/contrib/handlers/clearml_logger.py
+++ b/ignite/contrib/handlers/clearml_logger.py
@@ -115,15 +115,10 @@ def __init__(self, **kwargs: Any):
             from clearml import Task
             from clearml.binding.frameworks.tensorflow_bind import WeightsGradientHistHelper
         except ImportError:
-            try:
-                # Backwards-compatibility for legacy Trains SDK
-                from trains import Task
-                from trains.binding.frameworks.tensorflow_bind import WeightsGradientHistHelper
-            except ImportError:
-                raise RuntimeError(
-                    "This contrib module requires clearml to be installed. "
-                    "You may install clearml using: \n pip install clearml \n"
-                )
+            raise RuntimeError(
+                "This contrib module requires clearml to be installed. "
+                "You may install clearml using: \n pip install clearml \n"
+            )
 
         experiment_kwargs = {k: v for k, v in kwargs.items() if k not in ("project_name", "task_name", "task_type")}
 
diff --git a/ignite/contrib/handlers/trains_logger.py b/ignite/contrib/handlers/trains_logger.py
deleted file mode 100644
--- a/ignite/contrib/handlers/trains_logger.py
+++ /dev/null
@@ -1,15 +0,0 @@
-""" ``trains_logger`` was renamed to ``clearml_logger``.
-
-Note:
-    ``trains_logger`` was renamed to ``clearml_logger``.
-    Please refer to :mod:`~ignite.contrib.handlers.clearml_logger`.
-"""
-from ignite.contrib.handlers.clearml_logger import ClearMLLogger, ClearMLSaver
-
-__all__ = [
-    "TrainsLogger",
-    "TrainsSaver",
-]
-
-TrainsLogger = ClearMLLogger
-TrainsSaver = ClearMLSaver


Test patch:
diff --git a/tests/ignite/contrib/handlers/test_clearml_logger.py b/tests/ignite/contrib/handlers/test_clearml_logger.py
--- a/tests/ignite/contrib/handlers/test_clearml_logger.py
+++ b/tests/ignite/contrib/handlers/test_clearml_logger.py
@@ -21,18 +21,11 @@
     WeightsHistHandler,
     WeightsScalarHandler,
 )
-from ignite.contrib.handlers.trains_logger import TrainsLogger
+
 from ignite.engine import Engine, Events, State
 from ignite.handlers import Checkpoint
 
 
-def test_trains_logger_alias(dirname):
-    with pytest.warns(UserWarning, match="ClearMLSaver: running in bypass mode"):
-        TrainsLogger.set_bypass_mode(True)
-        logger = TrainsLogger(output_uri=dirname)
-        assert isinstance(logger, ClearMLLogger)
-
-
 def test_optimizer_params_handler_wrong_setup():
 
     with pytest.raises(TypeError):