Skip to content

automatically override progress_bar_refresh_rate in google colab #3786

@nateraw

Description

@nateraw

🚀 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs an improvement or enhancementgood first issueGood for newcomershelp wantedOpen to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions