The Wayback Machine - https://web.archive.org/web/20200520094439/https://github.com/PyTorchLightning/pytorch-lightning/issues/906
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve wandb tests #906

Open
ghost opened this issue Feb 20, 2020 · 2 comments
Open

Improve wandb tests #906

ghost opened this issue Feb 20, 2020 · 2 comments

Comments

@ghost
Copy link

@ghost ghost commented Feb 20, 2020

The tests of the wandb-logger are not as comprehensive as for the rest of the loggers. Currently, they just test if constructing a logger works.

Testing wandb in the same way as the other loggers works:

def test_wandb_logger(tmpdir):
    """Verify that basic functionality of wandb logger works."""
    tutils.reset_seed()

    wandb_dir = os.path.join(tmpdir, "wandb")
    logger = WandbLogger(save_dir=wandb_dir, anonymous=True, offline=True)

    hparams = tutils.get_hparams()
    model = LightningTestModel(hparams)

    trainer_options = dict(
        default_save_path=tmpdir,
        max_epochs=1,
        train_percent_check=0.05,
        logger=logger
    )

    trainer = Trainer(**trainer_options)
    result = trainer.fit(model)

    print('result finished')
    assert result == 1, "Training failed"


def test_wandb_pickle(tmpdir):
    """Verify that pickling trainer with wandb logger works."""
    tutils.reset_seed()

    wandb_dir = str(tmpdir)
    logger = WandbLogger(save_dir=wandb_dir, anonymous=True)
    trainer_options = dict(
        default_save_path=tmpdir,
        max_epochs=1,
        logger=logger
    )

    trainer = Trainer(**trainer_options)
    pkl_bytes = pickle.dumps(trainer)
    trainer2 = pickle.loads(pkl_bytes)
    trainer2.logger.log_metrics({"acc": 1.0})

But the CI tests on github for windows fail. The tests for Ubuntu and Mac work. Seems to be some problem related to file-access that I cannot recreate locally

@Borda
Copy link
Member

@Borda Borda commented Apr 16, 2020

@borisdayma mind send a PR? 🦝

@borisdayma
Copy link
Contributor

@borisdayma borisdayma commented Apr 16, 2020

I think you guys fixed it here: f862d9f

@Borda Borda modified the milestones: 0.7.4, 0.7.5 Apr 24, 2020
@Borda Borda modified the milestones: 0.7.6, 0.8.0, 0.7.7 May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.