Skip to content

Commit 10ef370

Browse files
authored
Code cosmetics (#88)
* Update main.py * Update main.py * [skip ci] updated main
1 parent 07d6401 commit 10ef370

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

templates/gan/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from datetime import datetime
77
from pathlib import Path
88
from typing import Any
9-
from ignite.contrib.handlers.wandb_logger import WandBLogger
109

1110
import torch
1211
import ignite.distributed as idist
@@ -215,6 +214,8 @@ def create_plots(engine):
215214
# ------------------------------------------------------------
216215

217216
if rank == 0:
217+
from ignite.contrib.handlers.wandb_logger import WandBLogger
218+
218219
if isinstance(logger_handler, WandBLogger):
219220
# why handle differently for wandb ?
220221
# See : https://github.com/pytorch/ignite/issues/1894

templates/image_classification/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from datetime import datetime
66
from pathlib import Path
77
from typing import Any
8-
from ignite.contrib.handlers.wandb_logger import WandBLogger
98

109
import ignite.distributed as idist
1110
from ignite.engine.events import Events
@@ -206,6 +205,8 @@ def _():
206205
# ------------------------------------------------------------
207206

208207
if rank == 0:
208+
from ignite.contrib.handlers.wandb_logger import WandBLogger
209+
209210
if isinstance(logger_handler, WandBLogger):
210211
# why handle differently for wandb ?
211212
# See : https://github.com/pytorch/ignite/issues/1894

templates/single/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from datetime import datetime
66
from pathlib import Path
77
from typing import Any
8-
from ignite.contrib.handlers.wandb_logger import WandBLogger
98

109
import ignite.distributed as idist
1110
from ignite.engine.events import Events
@@ -185,6 +184,8 @@ def _():
185184
# ------------------------------------------------------------
186185

187186
if rank == 0:
187+
from ignite.contrib.handlers.wandb_logger import WandBLogger
188+
188189
if isinstance(logger_handler, WandBLogger):
189190
# why handle differently for wandb ?
190191
# See : https://github.com/pytorch/ignite/issues/1894

0 commit comments

Comments
 (0)