Python package for reporting your ML training status in realtime on slack channel.
Project description
Introducing slackker! :fire:
slackker is a python package for monitoring your ML training status in real-time on slack channel. It can send you update for your ML model training progress and send final report with graphs when the training finishes. So now you don't have to sit in front of the machine all the time. You can quickly go and grab coffee :coffee: downstairs or run some errands and still keep tracking the progress while on the move.
Star this repo if this has been useful in your ML training workflows! :star2:
Table of contents :notebook:
Requirements :clipboard:
slackkerutilises slack_sdk>=3.19.0for communicating with slack API.- To use the
slackker.callbacksmethod in keras.callbackss keras>=2.0.0is required.
Installation :arrow_down:
- Install slackker from PyPi is recommended. slackker is compatible with
Python >= 3.6and runs on Linux, MacOS X and Windows. - Installing slackker in your environment is easy. Just use below pip command:
pip install slackker
Getting started with slackker callbacks
Setup Slack to work with slackker
- First create an slack app from scratch in your workspace.
- we must give below mentioned permissions for
slackkerto be able to send status update and report to your channel:chat:writechat:write.publicfiles:readfiles:write
- Now install the app to your workspace and copy our apps Bot & OAuth Token. it should be in following format:
xoxb-123234234235-123234234235-123234234235-adedce74748c3844747aed48499bb
- Now go to slack and add this slack app to the channel where you wish to receive al the update. Now we are ready to use
slackkerin your training flow!:smiling_imp:
Using slackker callbacks with keras callbacks method
Import slackker.callbacks with following line:
from slackker.callbacks import SLKerasUpdate
Create slackker object
create slackker object with SLKerasUpdate
slack_update = SLKerasUpdate(token="xoxb-123234234235-123234234235-123234234235-adedce74748c3844747aed48499bb",
channel="A04AAB77ABC",
modelName='SampleModel',
export='png',
sendPlot=True,
verbose=0)
SLKerasUpdate takes following arguments:
token: (string) Slack app tokenchannel: (string) Slack channel where you want to receive updates (make sure you have added slack app to this same channel)modelName: (string) Name for your model. This same name will be used in future for title of the generated plots.export: (string) default"png": Format for plots to be exported. (supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff)sendPlots: (Bool) defaultTrue: If set toTrueit will export history of model, both training and validation, save it in the format given inexportargument and send graphs to slack channel when training ends. If set toFalseit will not send exported graphs to slack channel.verbose: (int) default0: You can sent the verbose level up to 3.verbose = 0No loggingverbose = 1Basic/minimal loggingverbose = 2Info loggingverbose = 3Debug/In-depth logging
Call slackker object into callbacks during model fit
Now you can call slackker object into callbacks argument just like any other callbacks object.
history = model.fit(x_train,
y_train,
epochs = 3,
batch_size = 16,
verbose=1,
validation_data=(x_val,y_val),
callbacks=[slack_update])
Final code
# Import library for keras
from slackker.callbacks import SLKerasUpdate
# Train-Test split for your keras model
x_train, x_test, y_train, y_test = train_test_split(x, y, train_size=0.8)
x_train, x_val, y_train, y_val = train_test_split(x_train, y_train, train_size=0.8)
# Build keras model
model = Sequential()
model.add(Dense(8,activation='relu',input_shape = (IMG_WIDTH, IMG_HEIGHT, DEPTH)))
model.add(Dense(3,activation='softmax'))
model.compile(optimizer = 'rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
# Create Slackker object
slack_update = SLKerasUpdate(token="xoxb-123234234235-123234234235-123234234235-adedce74748c3844747aed48499bb",
channel="A04AAB77ABC",
modelName='SampleModel',
export='png',
sendPlot=True)
# Call Slackker object in model.fit() callbacks
history = model.fit(x_train,
y_train,
epochs = 3,
batch_size = 16,
verbose=1,
validation_data=(x_val,y_val),
callbacks=[slack_update])
Support :sparkles:
If you get stuck, we’re here to help. The following are the best ways to get assistance working through your issue:
- Use our Github Issue Tracker for reporting bugs or requesting features.
Contribution are the best way to keep
slackkeramazing :muscle: - If you want to contribute please refer Contributor's Guide for how to contribute in a helpful and collaborative way :innocent:
Citation :page_facing_up:
Please cite slackker in your publications if this is useful for your research. Here is an example BibTeX entry:
@misc{siddheshgunjal2023slackker,
title={slackker},
author={Siddhesh Gunjal},
year={2023},
howpublished={\url{https://github.com/siddheshgunjal/slackker}},
}
Maintainer :sunglasses:
- Siddhesh Gunjal :sunglasses:
- GitHub: Siddhesh Gunjal
- LinkedIn: LinkedIn
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slackker-1.0.0.tar.gz.
File metadata
- Download URL: slackker-1.0.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
074d8df58cce2f6dd43c52d4b127b1fdd704849712d7049d753df653d9a0c380
|
|
| MD5 |
e45ef77c9ddd961a69249827f45babee
|
|
| BLAKE2b-256 |
674bc64c6719270815b25c8eeb3ffd98ec552926e074a9792a7b7ac5c8174690
|
File details
Details for the file slackker-1.0.0-py3-none-any.whl.
File metadata
- Download URL: slackker-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae1ddafe7a64b3eed53fbae5e82bc5e44b321dd5f0963a76ff0e2046d6a32a3f
|
|
| MD5 |
8996928100711305338895e0425441a7
|
|
| BLAKE2b-256 |
9d165636a903a8b4a6230a3a863bdf096de85c10200353e8b2613d2087c12384
|