Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 24, 2021
1 parent 3f3b86f commit ebd5e3f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions pl_examples/basic_examples/autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ def val_dataloader(self):
def test_dataloader(self):
return DataLoader(self.mnist_test, batch_size=self.batch_size)


class WandBandSafeConfigCallBackFixCLI(LightningCLI):

def add_arguments_to_parser(self, parser):
parser.add_argument('save_config_callback_filename', default='',
help='Change config filename in order to avoid clashes with wandb.'
'TODO submit PR for setting this in LightningCLI constructor/self.config')
parser.add_argument(
'save_config_callback_filename',
default='',
help='Change config filename in order to avoid clashes with wandb.'
'TODO submit PR for setting this in LightningCLI constructor/self.config'
)

def before_fit(self):
save_config_cb = [c for c in self.trainer.callbacks if isinstance(c, SaveConfigCallback)]
Expand Down
4 changes: 2 additions & 2 deletions pl_examples/basic_examples/autoencoder.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# See SaveConfigCallback config_filename: str = 'config.yaml'
# This breaks the example
save_config_callback_filename: '' # Keeps the LightningCLI intact - do not apply workaround
#
#
# Workaround - UNCOMMENT TO MAKE THE EXAMPLE WORKING or specify as CLI option
# save_config_callback_filename: 'another-name-config.yaml # See WandBandSafeConfigCallBackFixCLI


trainer:
max_epochs: 3
logger:
class_path: pytorch_lightning.loggers.WandbLogger
class_path: pytorch_lightning.loggers.WandbLogger
init_args:
name: oplatek-pl-documenting-wandb-lightningCLI-clash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ARGS_EXTRA_DDP=" --trainer.gpus 2 --trainer.accelerator ddp"
ARGS_EXTRA_AMP=" --trainer.precision 16"

# conda created with the following command in the git root directory
# conda created with the following command in the git root directory
# conda env create --file environment.yml --prefix $PWD/env
# conda activate $PWD/env
# pip install pytorch-lightning==1.3.2
Expand Down

0 comments on commit ebd5e3f

Please sign in to comment.