Pytorch-lightning: automatically override progress_bar_refresh_rate in google colab

Created on 2 Oct 2020  路  2Comments  路  Source: PyTorchLightning/pytorch-lightning

馃殌 Feature

If running on google colab, automatically assign progress_bar_refresh_rate=20 if the user didn't override the default of 1.

Motivation

Google colab is notorious for crashing because of the tqdm progress bar while training. We usually solve that by assigning a larger number to progress_bar_refresh_rate flag of Trainer. However, this is super annoying since you have to do it all the time.

Also, when writing up examples for beginners, it would be nice to just say pl.Trainer() instead of having to pass the refresh rate flag, as that may confuse newcomers.

Pitch

Put this logic in CallbackConnector, or ProgressBarBase. I'm not sure which makes more sense.

import sys


def check_if_on_google_colab():
    return 'google.colab' in sys.modules

Alternatives

Additional context

enhancement good first issue help wanted

Most helpful comment

Yes please, this is nice. It crashes my whole Chrome if I forget it, it's annoying.
I would put it into the callback connector for the default case because in the progressbarBase it could override the settings if a user has a custom bar and that's probably undesired?

All 2 comments

Yes please, this is nice. It crashes my whole Chrome if I forget it, it's annoying.
I would put it into the callback connector for the default case because in the progressbarBase it could override the settings if a user has a custom bar and that's probably undesired?

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mmsamiei picture mmsamiei  路  3Comments

baeseongsu picture baeseongsu  路  3Comments

srush picture srush  路  3Comments

versatran01 picture versatran01  路  3Comments

Vichoko picture Vichoko  路  3Comments