Skip to content

Commit aadc82a

Browse files
Merge branch 'master' into final-clean-handler-3563
2 parents bf633d3 + 3f26c5b commit aadc82a

3 files changed

Lines changed: 9 additions & 17 deletions

File tree

examples/mnist/mnist_with_neptune_logger.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
python mnist_with_neptune_logger.py
1212
```
1313
14-
Go to https://neptune.ai and explore your run.
15-
16-
Note:
17-
You can view example runs here:
18-
https://app.neptune.ai/o/common/org/pytorch-ignite-integration/
1914
"""
2015

2116
from argparse import ArgumentParser

ignite/handlers/neptune_logger.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535

3636
class NeptuneLogger(BaseLogger):
3737
"""
38-
`Neptune <https://neptune.ai/>`_ handler to log metrics, model/optimizer parameters and gradients during training
38+
Neptune handler to log metrics, model/optimizer parameters and gradients during training
3939
and validation. It can also log model checkpoints to Neptune.
4040
4141
.. code-block:: bash
4242
4343
pip install neptune
4444
4545
Args:
46-
api_token: Neptune API token, found on https://neptune.ai -> User menu -> "Get your API token".
46+
api_token: Neptune API token, found on the Neptune user menu -> "Get your API token".
4747
If None, the value of the NEPTUNE_API_TOKEN environment variable is used. To keep your token
4848
secure, you should set it to the environment variable rather than including it in your code.
4949
project: Name of a Neptune project, in the form "workspace-name/project-name".
@@ -113,9 +113,6 @@ class NeptuneLogger(BaseLogger):
113113
log_handler=WeightsScalarHandler(model),
114114
)
115115
116-
Explore runs with Neptune tracking here:
117-
https://app.neptune.ai/o/common/org/pytorch-ignite-integration/
118-
119116
You can also save model checkpoints to a Neptune:
120117
121118
.. code-block:: python
@@ -662,9 +659,6 @@ def score_function(engine):
662659
# We need to close the logger when we are done
663660
npt_logger.close()
664661
665-
For example, you can access model checkpoints and download them from here:
666-
https://app.neptune.ai/o/shared/org/pytorch-ignite-integration/e/PYTOR1-18/charts
667-
668662
"""
669663

670664
@idist.one_rank_only()

tests/ignite/distributed/test_launcher.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ def execute(cmd, env=None):
4848
env = dict(os.environ) if env is None else env
4949
env["PYTHONPATH"] = f"{os.path.dirname(ignite.__path__[0])}"
5050
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
51-
process.wait()
51+
stdout, stderr = process.communicate()
52+
stdout_str = stdout.decode("utf-8", errors="replace") if stdout else ""
53+
stderr_str = stderr.decode("utf-8", errors="replace") if stderr else ""
54+
5255
if process.returncode != 0:
53-
print(str(process.stdout.read()) + str(process.stderr.read()))
54-
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd, stderr=process.stderr.read())
55-
return str(process.stdout.read()) + str(process.stderr.read())
56+
print(stdout_str + stderr_str)
57+
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd, stderr=stderr_str)
58+
return stdout_str + stderr_str
5659

5760

5861
@pytest.mark.skipif(not is_mps_available_and_functional(), reason="Skip if MPS not functional")

0 commit comments

Comments
 (0)