Learn practical skills, build real-world projects, and advance your career

Slack notifications for FastAI

Get slack notifications for FastAI model training. fastai_slack provides a simple callback to receive Slack notifcations while training FastAI models, with just one extra line of code.

alt

fastai_slack sends notifications to your chosen Slack workspace & channel for the following events:

  • Start of training
  • Losses and metrics at the end of every epoch (or every few epochs)
  • End of training
  • Exceptions that occur during training (with stack trace)

Installation and Setup

  1. Install the fastai_slack library using pip:
pip install fastai_slack
  1. Generate a Slack incoming webhook URL, which will allow you to send notifications to a Slack channel of your choice. More details here: https://api.slack.com/incoming-webhooks

The webhook URL should be kept secret, so fastai_slack provides a helpful read_webhook_url method to safely input webhook URL within Jupyter.

from fastai_slack import read_webhook_url
webhook_url = read_webhook_url()
Enter webhook URL: ········

Usage

fastai_slack provides a callback called SlackCallback which you can include within the fit function call.

As an example, let's train a ResNet18 network on the MINST dataset.

from fastai.vision import *