Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# 2) mnist_with_visdom.py
python -c "from visdom.server.build import download_scripts; download_scripts()" # download scripts : https://github.com/facebookresearch/visdom/blob/master/py/server.py#L929
python -m visdom.server &
sleep 10
python examples/mnist/mnist_with_visdom.py --epochs=1
kill %1
# Visdom is unmaintained and cannot be installed with modern packages
# python -c "from visdom.server.build import download_scripts; download_scripts()" # download scripts : https://github.com/facebookresearch/visdom/blob/master/py/server.py#L929
# python -m visdom.server &
# sleep 10
# python examples/mnist/mnist_with_visdom.py --epochs=1
# kill %1
# 3.1) mnist_with_tensorboard.py with tbX
python examples/mnist/mnist_with_tensorboard.py --epochs=1
# 3.2) mnist_with_tensorboard.py with native torch tb
Expand Down
5 changes: 5 additions & 0 deletions ignite/contrib/engines/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ def setup_visdom_logging(
- Learning rate(s)
- Evaluation metrics
.. warning::
This function uses VisdomLogger which is currently untested due to the visdom package being
unmaintained and difficult to install with modern Python packages. Use at your own risk.
Args:
trainer: trainer engine
optimizers: single or dictionary of
Expand Down
7 changes: 6 additions & 1 deletion ignite/handlers/visdom_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class VisdomLogger(BaseLogger):
"""
VisdomLogger handler to log metrics, model/optimizer parameters, gradients during the training and validation.
.. warning::
This logger is currently untested due to the visdom package being unmaintained and difficult to install
with modern Python packages. Use at your own risk.
This class requires `visdom <https://github.com/fossasia/visdom/>`_ package to be installed:
.. code-block:: bash
Expand Down Expand Up @@ -156,7 +161,7 @@ def __init__(
**kwargs: Any,
):
try:
import visdom
import visdom # pyrefly: ignore
except ImportError:
raise ModuleNotFoundError(
"This contrib module requires visdom package. "
Expand Down
4 changes: 3 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tqdm
scikit-learn
matplotlib
tensorboardX
visdom
# visdom # Removed: unmaintained package, cannot be installed with modern packages
polyaxon
wandb
mlflow
Expand All @@ -27,6 +27,8 @@ torchvision
pynvml<12 # pynvml module was removed in 12.X, is not developed or maintained. We should replace pynvml with something else.
clearml
scikit-image
# TODO: py-rouge is very old package and its code should vendored into our rouge tests and finally remove py-rouge dependency
setuptools<82
py-rouge
pycocotools
# temporary fix for python=3.12 and v3.8.1
Expand Down
1 change: 1 addition & 0 deletions tests/ignite/contrib/engines/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def test_setup_tb_logging(dirname):


@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
@pytest.mark.skip(reason="Visdom is unmaintained and cannot be installed with modern packages")
def test_setup_visdom_logging(visdom_offline_logfile):
vis_logger = _test_setup_logging(
setup_logging_fn=setup_visdom_logging,
Expand Down
6 changes: 4 additions & 2 deletions tests/ignite/handlers/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

import pytest
import torch
from visdom import Visdom
from visdom.server.build import download_scripts


@pytest.fixture(scope="session")
def visdom_server():
# Start Visdom server once and stop it with visdom_server_stop

from visdom import Visdom
from visdom.server.build import download_scripts

vd_hostname = "localhost"
if not (Path.home() / ".visdom").exists():
(Path.home() / ".visdom").mkdir(exist_ok=True)
Expand Down
9 changes: 6 additions & 3 deletions tests/ignite/handlers/test_visdom_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
WeightsScalarHandler,
)

# Run tests on a single worker to avoid issues with connecting to the visdom
# server This requires that the --dist=loadgroup option be passed to pytest.
pytestmark = [pytest.mark.timeout(30), pytest.mark.xdist_group(name="visdom")]
# Skip all tests in this module: visdom is unmaintained and cannot be installed with modern packages
pytestmark = [
pytest.mark.skip(reason="Visdom is unmaintained and cannot be installed with modern packages"),
pytest.mark.timeout(30),
pytest.mark.xdist_group(name="visdom"),
]


def test_optimizer_params_handler_wrong_setup():
Expand Down
Loading