mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ca9f111f5 | ||
|
|
b41f76c7c5 | ||
|
|
d52f9d5227 |
@@ -127,7 +127,7 @@ import sys
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
import torch
|
||||
import tqdm
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from pytorch_lightning.utilities.debugging import MisconfigurationException
|
||||
|
||||
@@ -293,9 +293,9 @@ class TrainerEvaluationLoopMixin(ABC):
|
||||
# main progress bar will already be closed when testing so initial position is free
|
||||
position = 2 * self.process_position + (not test)
|
||||
desc = 'Testing' if test else 'Validating'
|
||||
pbar = tqdm.tqdm(desc=desc, total=max_batches, leave=test, position=position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True,
|
||||
unit='batch', file=sys.stdout)
|
||||
pbar = tqdm(desc=desc, total=max_batches, leave=test, position=position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True,
|
||||
unit='batch', file=sys.stdout)
|
||||
setattr(self, f'{"test" if test else "val"}_progress_bar', pbar)
|
||||
|
||||
# run evaluation
|
||||
|
||||
@@ -7,7 +7,7 @@ import logging
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
import torch.multiprocessing as mp
|
||||
import tqdm
|
||||
from tqdm.auto import tqdm
|
||||
from torch.optim.optimizer import Optimizer
|
||||
|
||||
from pytorch_lightning.trainer.auto_mix_precision import TrainerAMPMixin
|
||||
@@ -808,13 +808,13 @@ class Trainer(TrainerIOMixin,
|
||||
ref_model.on_train_start()
|
||||
if not self.disable_validation and self.num_sanity_val_steps > 0:
|
||||
# init progress bars for validation sanity check
|
||||
pbar = tqdm.tqdm(desc='Validation sanity check',
|
||||
pbar = tqdm(desc='Validation sanity check',
|
||||
total=self.num_sanity_val_steps * len(self.get_val_dataloaders()),
|
||||
leave=False, position=2 * self.process_position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch')
|
||||
self.main_progress_bar = pbar
|
||||
# dummy validation progress bar
|
||||
self.val_progress_bar = tqdm.tqdm(disable=True)
|
||||
self.val_progress_bar = tqdm(disable=True)
|
||||
|
||||
eval_results = self.evaluate(model, self.get_val_dataloaders(),
|
||||
self.num_sanity_val_steps, False)
|
||||
@@ -828,9 +828,9 @@ class Trainer(TrainerIOMixin,
|
||||
self.early_stop_callback.check_metrics(callback_metrics)
|
||||
|
||||
# init progress bar
|
||||
pbar = tqdm.tqdm(leave=True, position=2 * self.process_position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch',
|
||||
file=sys.stdout)
|
||||
pbar = tqdm(leave=True, position=2 * self.process_position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch',
|
||||
file=sys.stdout)
|
||||
self.main_progress_bar = pbar
|
||||
|
||||
# clear cache before training
|
||||
|
||||
Reference in New Issue
Block a user