Compare commits

...
5 Commits
Author SHA1 Message Date
William Falcon d794ee4522 Merge branch 'master' into tb 2020-01-13 22:13:59 -05:00
William Falcon 99c9b82527 made tensorboard the default not test-tube 2019-12-07 23:36:51 -05:00
William Falcon 47a82cf1b9 refactor 2019-12-07 23:32:17 -05:00
William Falcon 1b86ed9cc3 refactor 2019-12-07 23:31:47 -05:00
William Falcon 94bd2ae3e1 refactor 2019-12-07 23:30:59 -05:00
3 changed files with 22 additions and 9 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import os
from abc import ABC from abc import ABC
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping
from pytorch_lightning.logging import TestTubeLogger from pytorch_lightning.logging import TensorboardLogger
class TrainerCallbackConfigMixin(ABC): class TrainerCallbackConfigMixin(ABC):
@@ -69,7 +69,7 @@ class TrainerCallbackConfigMixin(ABC):
# configure logger # configure logger
if logger is True: if logger is True:
# default logger # default logger
self.logger = TestTubeLogger( self.logger = TensorboardLogger(
save_dir=self.default_save_path, save_dir=self.default_save_path,
version=self.slurm_job_id, version=self.slurm_job_id,
name='lightning_logs' name='lightning_logs'
+19 -6
View File
@@ -139,41 +139,53 @@ class Trainer(TrainerIOMixin,
""" """
# Transfer params # Transfer params
if nb_gpu_nodes is not None: # Backward compatibility # Backward compatibility
if nb_gpu_nodes is not None:
warnings.warn("`nb_gpu_nodes` has renamed to `num_nodes` since v0.5.0" warnings.warn("`nb_gpu_nodes` has renamed to `num_nodes` since v0.5.0"
" and will be removed in v0.8.0", DeprecationWarning) " and will be removed in v0.8.0", DeprecationWarning)
if not num_nodes: # in case you did not set the proper value if not num_nodes: # in case you did not set the proper value
num_nodes = nb_gpu_nodes num_nodes = nb_gpu_nodes
self.num_gpu_nodes = num_nodes self.num_gpu_nodes = num_nodes
self.log_gpu_memory = log_gpu_memory self.log_gpu_memory = log_gpu_memory
if gradient_clip is not None: # Backward compatibility
# Backward compatibility
if gradient_clip is not None:
warnings.warn("`gradient_clip` has renamed to `gradient_clip_val` since v0.5.0" warnings.warn("`gradient_clip` has renamed to `gradient_clip_val` since v0.5.0"
" and will be removed in v0.8.0", DeprecationWarning) " and will be removed in v0.8.0", DeprecationWarning)
if not gradient_clip_val: # in case you did not set the proper value if not gradient_clip_val: # in case you did not set the proper value
gradient_clip_val = gradient_clip gradient_clip_val = gradient_clip
self.gradient_clip_val = gradient_clip_val self.gradient_clip_val = gradient_clip_val
self.check_val_every_n_epoch = check_val_every_n_epoch self.check_val_every_n_epoch = check_val_every_n_epoch
self.track_grad_norm = track_grad_norm self.track_grad_norm = track_grad_norm
self.on_gpu = True if (gpus and torch.cuda.is_available()) else False self.on_gpu = True if (gpus and torch.cuda.is_available()) else False
self.process_position = process_position self.process_position = process_position
self.weights_summary = weights_summary self.weights_summary = weights_summary
if max_nb_epochs is not None: # Backward compatibility
# Backward compatibility
if max_nb_epochs is not None:
warnings.warn("`max_nb_epochs` has renamed to `max_epochs` since v0.5.0" warnings.warn("`max_nb_epochs` has renamed to `max_epochs` since v0.5.0"
" and will be removed in v0.8.0", DeprecationWarning) " and will be removed in v0.8.0", DeprecationWarning)
if not max_epochs: # in case you did not set the proper value if not max_epochs: # in case you did not set the proper value
max_epochs = max_nb_epochs max_epochs = max_nb_epochs
self.max_epochs = max_epochs self.max_epochs = max_epochs
if min_nb_epochs is not None: # Backward compatibility
# Backward compatibility
if min_nb_epochs is not None:
warnings.warn("`min_nb_epochs` has renamed to `min_epochs` since v0.5.0" warnings.warn("`min_nb_epochs` has renamed to `min_epochs` since v0.5.0"
" and will be removed in v0.8.0", DeprecationWarning) " and will be removed in v0.8.0", DeprecationWarning)
if not min_epochs: # in case you did not set the proper value if not min_epochs: # in case you did not set the proper value
min_epochs = min_nb_epochs min_epochs = min_nb_epochs
self.min_epochs = min_epochs self.min_epochs = min_epochs
if nb_sanity_val_steps is not None: # Backward compatibility
# Backward compatibility
if nb_sanity_val_steps is not None:
warnings.warn("`nb_sanity_val_steps` has renamed to `num_sanity_val_steps` since v0.5.0" warnings.warn("`nb_sanity_val_steps` has renamed to `num_sanity_val_steps` since v0.5.0"
" and will be removed in v0.8.0", DeprecationWarning) " and will be removed in v0.8.0", DeprecationWarning)
if not num_sanity_val_steps: # in case you did not set the proper value if not num_sanity_val_steps: # in case you did not set the proper value
num_sanity_val_steps = nb_sanity_val_steps num_sanity_val_steps = nb_sanity_val_steps
self.num_sanity_val_steps = num_sanity_val_steps self.num_sanity_val_steps = num_sanity_val_steps
self.print_nan_grads = print_nan_grads self.print_nan_grads = print_nan_grads
self.truncated_bptt_steps = truncated_bptt_steps self.truncated_bptt_steps = truncated_bptt_steps
@@ -261,8 +273,9 @@ class Trainer(TrainerIOMixin,
# logging # logging
self.log_save_interval = log_save_interval self.log_save_interval = log_save_interval
self.val_check_interval = val_check_interval self.val_check_interval = val_check_interval
if add_row_log_interval is not None:
# backward compatibility # backward compatibility
if add_row_log_interval is not None:
warnings.warn("`add_row_log_interval` has renamed to `row_log_interval` since v0.5.0" warnings.warn("`add_row_log_interval` has renamed to `row_log_interval` since v0.5.0"
" and will be removed in v0.8.0", DeprecationWarning) " and will be removed in v0.8.0", DeprecationWarning)
if not row_log_interval: # in case you did not set the proper value if not row_log_interval: # in case you did not set the proper value