8000 Fix visdom tests for `macos-latest` by trsvchn · Pull Request #2253 · pytorch/ignite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix visdom tests for macos-latest #2253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 6, 2021
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
13 changes: 3 additions & 10 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
max-parallel: 10
fail-fast: false
Expand Down Expand Up @@ -50,7 +53,6 @@ jobs:
id: get-date
run: |
echo "::set-output name=date::$(/bin/date "+%Y-%U")"
shell: bash -l {0}

- name: Get pip cache dir
id: pip-cache
Expand Down Expand Up @@ -100,12 +102,10 @@ jobs:

# Copy MNIST to "." for the examples
- name: Copy MNIST
shell: bash -l {0}
run: |
cp -R /tmp/MNIST .

- name: Run Tests
shell: bash -l {0}
run: |
SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} bash tests/run_cpu_tests.sh

Expand All @@ -117,14 +117,12 @@ jobs:
fail_ci_if_error: false

- name: Run MNIST Examples
shell: bash -l {0}
run: |
# MNIST
# 1) mnist.py
python examples/mnist/mnist.py --epochs=1

- name: Run MNIST with loggers Examples
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# 2) mnist_with_visdom.py
Expand All @@ -140,28 +138,24 @@ jobs:
python examples/mnist/mnist_with_tensorboard.py --epochs=1

- name: Run MNIST Example With Crash
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
continue-on-error: true
run: |
# 4) mnist_save_resume_engine.py
python examples/mnist/mnist_save_resume_engine.py --epochs=2 --crash_iteration 1100

- name: Resume MNIST from previous crash
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
python examples/mnist/mnist_save_resume_engine.py --epochs=2 --resume_from=/tmp/mnist_save_resume/checkpoint_1.pt

- name: Run GAN example
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# DCGAN
python examples/gan/dcgan.py --dataset fake --dataroot /tmp/fakedata --output-dir /tmp/outputs-dcgan --batch-size 2 --epochs 2 --workers 0

- name: Run RL Examples
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# RL
Expand All @@ -171,7 +165,6 @@ jobs:
python examples/reinforcement_learning/reinforce.py --max-episodes=2

- name: Run Neural Style Example
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
#fast-neural-style
Expand Down
20 changes: 5 additions & 15 deletions tests/ignite/contrib/handlers/test_visdom_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,19 +870,15 @@ def test_integration_no_server():
VisdomLogger()


@pytest.mark.skipif(
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
)
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
def test_logger_init_hostname_port(visdom_server):
# Explicit hostname, port
vd_logger = VisdomLogger(server=visdom_server[0], port=visdom_server[1], num_workers=0)
assert "main" in vd_logger.vis.get_env_list()
vd_logger.close()


@pytest.mark.skipif(
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
)
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
def test_logger_init_env_vars(visdom_server):
# As env vars
import os
Expand All @@ -900,9 +896,7 @@ def _parse_content(content):
return json.loads(content)


@pytest.mark.skipif(
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
)
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
def test_integration_no_executor(visdom_server):
vd_logger = VisdomLogger(server=visdom_server[0], port=visdom_server[1], num_workers=0)

Expand Down Expand Up @@ -938,9 +932,7 @@ def update_fn(engine, batch):
vd_logger.close()


@pytest.mark.skipif(
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
)
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
def test_integration_with_executor(visdom_server):
6B87 vd_logger = VisdomLogger(server=visdom_server[0], port=visdom_server[1], num_workers=1)

Expand Down Expand Up @@ -977,9 +969,7 @@ def update_fn(engine, batch):
vd_logger.close()


@pytest.mark.skipif(
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
)
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
def test_integration_with_executor_as_context_manager(visdom_server, visdom_server_stop):

n_epochs = 5
Expand Down
0