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

Closed
ghost opened this issue Feb 20, 2020 · 5 comments
Closed

Improve wandb tests #906

ghost opened this issue Feb 20, 2020 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Open to be worked on
Milestone

Comments

@ghost
Copy link

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 Borda added bug Something isn't working good first issue Good for newcomers help wanted Open to be worked on labels Feb 20, 2020
@Borda Borda modified the milestones: 0.6.1, 0.6.2 Feb 20, 2020
@williamFalcon williamFalcon modified the milestones: 0.7.2, 0.8.0 Apr 7, 2020
@Borda Borda modified the milestones: 0.8.0, 0.7.4 Apr 16, 2020
@Borda
Copy link
Member

Borda commented Apr 16, 2020

@borisdayma mind send a PR? 🦝

@borisdayma
Copy link
Contributor

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
@Borda Borda modified the milestones: 0.7.7, 0.8.0 May 26, 2020
@edenlightning
Copy link
Contributor

@Borda can we close this?

@Borda Borda modified the milestones: 0.8.0, 0.9.0 Jun 9, 2020
@awaelchli
Copy link
Contributor

The wandb logger is now included in the other tests as well and the todos that @Borda pointed out are gone.
It is tested also for pickling and folder structure / paths for logged files.
I would argue it is now at the similar level as other loggers. Shall we close?

@Borda Borda closed this as completed Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Open to be worked on
Projects
None yet
Development

No branches or pull requests

5 participants