🚪✊Knock Knock: Get notified when your training ends with only two additional lines of code

Overview

Knock Knock

made-with-python Downloads Downloads GitHub stars

A small library to get a notification when your training is complete or when it crashes during the process with two additional lines of code.

When training deep learning models, it is common to use early stopping. Apart from a rough estimate, it is difficult to predict when the training will finish. Thus, it can be interesting to set up automatic notifications for your training. It is also interesting to be notified when your training crashes in the middle of the process for unexpected reasons.

Installation

Install with pip or equivalent.

pip install knockknock

This code has only been tested with Python >= 3.6.

Usage

The library is designed to be used in a seamless way, with minimal code modification: you only need to add a decorator on top your main function call. The return value (if there is one) is also reported in the notification.

There are currently twelve ways to setup notifications:

Platform External Contributors
email -
Slack -
Telegram -
Microsoft Teams @noklam
Text Message @abhishekkrthakur
Discord @watkinsm
Desktop @atakanyenel @eyalmazuz
Matrix @jcklie
Amazon Chime @prabhakar267
DingTalk @wuutiing
RocketChat @radao
WeChat Work @jcyk

Email

The service relies on Yagmail a GMAIL/SMTP client. You'll need a gmail email address to use it (you can setup one here, it's free). I recommend creating a new one (rather than your usual one) since you'll have to modify the account's security settings to allow the Python library to access it by Turning on less secure apps.

Python

", " "], sender_email=" ") def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import email_sender

@email_sender(recipient_emails=["
       
       
        
        "
       
       , "
       
       
        
        "
       
       ], sender_email="
       
       
        
        "
       
       )
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock email \
    --recipient-emails <[email protected]>,<[email protected]> \
    --sender-email <grandma'[email protected]> \
    sleep 10

If sender_email is not specified, then the first email in recipient_emails will be used as the sender's email.

Note that launching this will asks you for the sender's email password. It will be safely stored in the system keyring service through the keyring Python library.

Slack

Similarly, you can also use Slack to get notifications. You'll have to get your Slack room webhook URL and optionally your user id (if you want to tag yourself or someone else).

Python

" @slack_sender(webhook_url=webhook_url, channel=" ") def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import slack_sender

webhook_url = "
     
     
      
      "
     
     
@slack_sender(webhook_url=webhook_url, channel="
      
      
       
       "
      
      )
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

You can also specify an optional argument to tag specific people: user_mentions=[ , ] .

Command-line

knockknock slack \
    --webhook-url <webhook_url_to_your_slack_room> \
    --channel <your_favorite_slack_channel> \
    sleep 10

You can also specify an optional argument to tag specific people: --user-mentions , .

Telegram

You can also use Telegram Messenger to get notifications. You'll first have to create your own notification bot by following the three steps provided by Telegram here and save your API access TOKEN.

Telegram bots are shy and can't send the first message so you'll have to do the first step. By sending the first message, you'll be able to get the chat_id required (identification of your messaging room) by visiting https://api.telegram.org/bot /getUpdates and get the int under the key message['chat']['id'].

Python

", chat_id=CHAT_ID) def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import telegram_sender

CHAT_ID: int = <your_messaging_room_id>
@telegram_sender(token="
    
    
     
     "
    
    , chat_id=CHAT_ID)
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock telegram \
    --token <your_api_token> \
    --chat-id <your_messaging_room_id> \
    sleep 10

Microsoft Teams

Thanks to @noklam, you can also use Microsoft Teams to get notifications. You'll have to get your Team Channel webhook URL.

Python

") def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10) return {'loss': 0.9} # Optional return value ">
from knockknock import teams_sender

@teams_sender(token="
     
     
      
      "
     
     )
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock teams \
    --webhook-url <webhook_url_to_your_teams_channel> \
    sleep 10

You can also specify an optional argument to tag specific people: user_mentions=[ , ] .

Text Message (SMS)

Thanks to @abhishekkrthakur, you can use Twilio to send text message notifications. You'll have to setup a Twilio account here, which is paid service with competitive prices: for instance in the US, getting a new number and sending one text message through this service respectively cost $1.00 and $0.0075. You'll need to get (a) a phone number, (b) your account SID and (c) your authentification token. Some detail here.

Python

" AUTH_TOKEN: str = " " @sms_sender(account_sid=ACCOUNT_SID, auth_token=AUTH_TOKEN, recipient_number=" ", sender_number=" ") def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10) return {'loss': 0.9} # Optional return value ">
from knockknock import sms_sender

ACCOUNT_SID: str = "
       
       
        
        "
       
       
AUTH_TOKEN: str = "
       
       
        
        "
       
       
@sms_sender(account_sid=ACCOUNT_SID, auth_token=AUTH_TOKEN, recipient_number="
        
        
         
         "
        
        , sender_number="
        
        
         
         "
        
        )
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock sms \
    --account-sid <your_account_sid> \
    --auth-token <your_account_auth_token> \
    --recipient-number <recipient_number> \
    --sender-number <sender_number>
    sleep 10

Discord

Thanks to @watkinsm, you can also use Discord to get notifications. You'll just have to get your Discord channel's webhook URL.

Python

" @discord_sender(webhook_url=webhook_url) def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import discord_sender

webhook_url = "
    
    
     
     "
    
    
@discord_sender(webhook_url=webhook_url)
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock discord \
    --webhook-url <webhook_url_to_your_discord_channel> \
    sleep 10

Desktop Notification

You can also get notified from a desktop notification. It is currently only available for MacOS and Linux and Windows 10. For Linux it uses the nofity-send command which uses libnotify, In order to use libnotify, you have to install a notification server. Cinnamon, Deepin, Enlightenment, GNOME, GNOME Flashback and KDE Plasma use their own implementations to display notifications. In other desktop environments, the notification server needs to be launched using your WM's/DE's "autostart" option.

Python

from knockknock import desktop_sender

@desktop_sender(title="Knockknock Desktop Notifier")
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {"loss": 0.9}

Command Line

knockknock desktop \
    --title 'Knockknock Desktop Notifier' \
    sleep 2

Matrix

Thanks to @jcklie, you can send notifications via Matrix. The homeserver is the server on which your user that will send messages is registered. Do not forget the schema for the URL (http or https). You'll have to get the access token for a bot or your own user. The easiest way to obtain it is to look into Riot looking in the riot settings, Help & About, down the bottom is: Access Token: . You also need to specify a room alias to which messages are sent. To obtain the alias in Riot, create a room you want to use, then open the room settings under Room Addresses and add an alias.

Python

" # e.g. https://matrix.org TOKEN = " " # e.g. WiTyGizlr8ntvBXdFfZLctyY ROOM = "
from knockknock import matrix_sender

HOMESERVER = "
      
      
       
       "
      
       # e.g. https://matrix.org
TOKEN = "
      
      
       
       "
      
                    # e.g. WiTyGizlr8ntvBXdFfZLctyY
ROOM = "
      
                           # e.g. #knockknock:matrix.org

@matrix_sender(homeserver=HOMESERVER, token=TOKEN, room=ROOM)
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock matrix \
    --homeserver <homeserver> \
    --token <token> \
    --room <room> \
    sleep 10

Amazon Chime

Thanks to @prabhakar267, you can also use Amazon Chime to get notifications. You'll have to get your Chime room webhook URL.

Python

") def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10) return {'loss': 0.9} # Optional return value ">
from knockknock import chime_sender

@chime_sender(webhook_url="
     
     
      
      "
     
     )
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock chime \
    --webhook-url <webhook_url_to_your_chime_room> \
    sleep 10

You can also specify an optional argument to tag specific people: user_mentions=[ , ] .

DingTalk

DingTalk is now supported thanks to @wuutiing. Given DingTalk chatroom robot's webhook url and secret/keywords(at least one of them are set when creating a chatroom robot), your notifications will be sent to reach any one in that chatroom.

Python

" @dingtalk_sender(webhook_url=webhook_url, secret=" ", keywords=[" "]) def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import dingtalk_sender

webhook_url = "
      
      
       
       "
      
      
@dingtalk_sender(webhook_url=webhook_url, secret="
       
       
        
        "
       
       , keywords=["
       
       
        
        "
       
       ])
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock dingtalk \
    --webhook-url <webhook_url_to_your_dingtalk_chatroom_robot> \
    --secret <your_robot_secret_if_set> \
    sleep 10

You can also specify an optional argument to at specific people: user_mentions=[" "] .

RocketChat

You can use RocketChat to get notifications. You'll need the following before you can post notifications:

  • a RocketChat server e.g. rocketchat.yourcompany.com
  • a RocketChat user id (you'll be able to view your user id when you create a personal access token in the next step)
  • a RocketChat personal access token (create one as per this guide)
  • a RocketChat channel

Python

", rocketchat_user_id=" ", rocketchat_auth_token=" ", channel=" ") def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import rocketchat_sender

@rocketchat_sender(
    rocketchat_server_url="
        
        
         
         "
        
        ,
    rocketchat_user_id="
        
        
         
         "
        
        ,
    rocketchat_auth_token="
        
        
         
         "
        
        ,
    channel="
        
        
         
         "
        
        )
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

You can also specify two optional arguments:

  • to tag specific users: user_mentions=[ , ]
  • to use an alias for the notification: alias="My Alias"

Command-line

knockknock rocketchat \
    --rocketchat-server-url <url_to_your_rocketchat_server> \
    --rocketchat-user-id <your_rocketchat_user_id> \
    --rocketchat-auth-token <your_rocketchat_auth_token> \
    --channel <channel_name> \
    sleep 10

WeChat Work

WeChat Work is now supported thanks to @jcyk. Given WeChat Work chatroom robot's webhook url, your notifications will be sent to reach anyone in that chatroom.

Python

" @wechat_sender(webhook_url=webhook_url) def train_your_nicest_model(your_nicest_parameters): import time time.sleep(10000) return {'loss': 0.9} # Optional return value ">
from knockknock import wechat_sender

webhook_url = "
    
    
     
     "
    
    
@wechat_sender(webhook_url=webhook_url)
def train_your_nicest_model(your_nicest_parameters):
    import time
    time.sleep(10000)
    return {'loss': 0.9} # Optional return value

Command-line

knockknock wechat \
    --webhook-url <webhook_url_to_your_wechat_work_chatroom_robot> \
    sleep 10

You can also specify an optional argument to tag specific people: user-mentions=[" "] and/or user-mentions-mobile=[" "] .

Note on distributed training

When using distributed training, a GPU is bound to its process using the local rank variable. Since knockknock works at the process level, if you are using 8 GPUs, you would get 8 notifications at the beginning and 8 notifications at the end... To circumvent that, except for errors, only the master process is allowed to send notifications so that you receive only one notification at the beginning and one notification at the end.

Note: In PyTorch, the launch of torch.distributed.launch sets up a RANK environment variable for each process (see here). This is used to detect the master process, and for now, the only simple way I came up with. Unfortunately, this is not intended to be general for all platforms but I would happily discuss smarter/better ways to handle distributed training in an issue/PR.

Comments
  • When the function finished, it still need the password?

    When the function finished, it still need the password?

    As the figure below, it needs the password when we start the work, it is ok cause we are on the computer now. But when the work finished, it still needs the password, we want to use this lib for convenient if we can't keep eyes on the computer, but as far, it can't solve the problem? image

    opened by ConanCui 8
  • socket.gaierror: [Errno -3] Temporary failure in name resolution

    socket.gaierror: [Errno -3] Temporary failure in name resolution

    Hi there,

    When I used the email sender example like below:

    from knockknock import email_sender
    
    @email_sender(recipient_email="<[email protected]>", sender_email="<grandma'[email protected]>")
    def train_your_nicest_model(your_nicest_parameters):
        import time
        time.sleep(10000)
        return {'loss': 0.9} # Optional return value
    

    I got below error:

    socket.gaierror: [Errno -3] Temporary failure in name resolution
    

    Any suggestion for this problem?

    Thanks

    opened by mikelkl 6
  • Added support for multiple recipient emails

    Added support for multiple recipient emails

    Hey there!

    I was reading through the issues page and saw a feature request to send emails to multiple recipients. I tweaked the original function into one where the user provides a list of emails instead.

    It works something like this:

    @email_sender(recipient_email_list=["<[email protected]>", "<[email protected]>"], sender_email="<grandma'[email protected]>")
    def train_your_nicest_model(your_nicest_parameters):
        import time
        time.sleep(10000)
        return {'loss': 0.9} # Optional return value
    

    It was a simple fix: I looped through all the recipient emails and sent it to all of them one by one.

    In the case that the sender_email is None, it will take the first email from the recipient_email_list list and assign it to the sender_email.

    Hope this is useful!

    opened by rish-16 5
  • Need a CONTRIBUTING.md. (Trouble setting up repository in Mac OS)

    Need a CONTRIBUTING.md. (Trouble setting up repository in Mac OS)

    I am trying to set up the repository locally on my machine (Mac OS) with virtual env and Python 3.7 but ran into an issue while trying to install 'win10toast==0.9'.

    I tried using pip3 install 'win10toast==0.9'

    Received this as an error:

    WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
    Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
    To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
    Defaulting to user installation because normal site-packages is not writeable
    Collecting win10toast==0.9
      Using cached win10toast-0.9-py2.py3-none-any.whl (21 kB)
    Requirement already satisfied: setuptools in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from win10toast==0.9) (40.8.0)
    Collecting pypiwin32
      Using cached pypiwin32-223-py3-none-any.whl (1.7 kB)
    ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32->win10toast==0.9) (from versions: none)
    ERROR: No matching distribution found for pywin32>=223 (from pypiwin32->win10toast==0.9)
    

    Quick google searches suggested installing pypiwin32/pywin32, but they did not do the trick :( Any quick pointers?

    Maybe worth putting together a setup or contributing guide for the repo?

    opened by narayanacharya6 4
  • Adding a desktop notification for macos

    Adding a desktop notification for macos

    Hello , I was thinking about adding desktop notification. You know the ones that pop up on upper right corner. I have a Mac but it can be extended by others with different OS's. It doesn't require any token info, maybe couple of configuration arguments , and can simply be called with @desktop_sender().

    It's not a hard task, there are already libraries for it , but nevertheless I would like to make the PR myself.

    What do you think ?

    opened by atakanyenel 4
  • Update PyPi version to 0.1.8.1

    Update PyPi version to 0.1.8.1

    Thank you for keeping up the good work on creating and maintaining this project!

    I can see that the version on the repo has updated to 0.1.8.1, can the same be pushed to PyPi?

    Thanks!

    opened by setu4993 3
  • add Wechat Work support

    add Wechat Work support

    add Wechat Work chatroom robot notification support. Wechat Work is one of the most popular business communication and office collaboration tool, developed by Tencent.

    opened by jcyk 3
  • Add Dingding

    Add Dingding

    Dingding (DingTalk) is a very widely used IM tool in China (basically Chinese version of Slack). Could you consider implement a support for Dingding?

    Here is a repo which you may directly refer to: https://github.com/zhh1115/dingtalk-webhook

    Thanks!

    opened by JetRunner 3
  • add desktop notification

    add desktop notification

    This is the trivial implementation for the functionality. It's a draft PR because the same function ran twice when I tested it with newly added test.py. For non osx, you can test it by comment outing the os specific line and replacing it with print.

    It should be very straightforward to add other OSes with os.name().

    This PR is discussed in #26

    opened by atakanyenel 3
  • Showing more details about training.

    Showing more details about training.

    Hello, sometimes I not only want to know when is the training finished, but also want to know what the result is (training loss, accuracy, F1-score, etc.). Is it possible to show these in email? It may work like this:

    1. the training function is called
    2. the training function successfully finish and return a dict like
    {
       loss:0.1,
       acc: 90,
       F1: 89
    }
    
    1. the decorator walk through the returned dict and report the result in the email.

    If this sound reasonable to you I may provide a PR later.

    Thanks!

    opened by huhk-sysu 3
  • New Feature: Add a config enable general decorator.

    New Feature: Add a config enable general decorator.

    Hey all,

    I just used knockknock frequently in my previous research experiment. And I found it is inconvenient at this time if I want to use knockknock multiple times in my codebase. Because I need to maintain consistent sender function parameters in my code everywhere. And it is easy to leakage my personal security token (such as slack webhook_url). As a result, I propose to add a general decorator to handle these tricky things.

    Property:

    1. This general decorator can parse a config file to handle different sender function parameters.
    2. The decorator can be silent when we are debugging our codebase. Since at the debug stage, we don't need verbose notification.
    3. Separate the sender config in an independent config file can mitigate the risk of information leakage. (Just adding the config file into your .gitignore file.)

    I finished the above properties. And I tested it on my personal desktop (Mac).

    Below are some code examples:

    • Usage of general decorator
    from knockknock import knockknock  # general decorator is named as knockknock (like tqdm)
    
    @knockknock(config_path='./', config_name='test.ini')  # directly set your config path
    def train_your_model(your_nicest_parameters):
        import time
        time.sleep(10)
        return {'loss': 0.9}  # Optional return value
    
    
    @knockknock(config_path='./', config_name='test.ini')  # convenient to use it multiple times in your codebase
    def eval_your_model(your_nicest_parameters):
        import time
        time.sleep(10)
        return {'acc': 0.9}  # Optional return value
    
    
    train_your_model(None)
    eval_your_model(None)
    
    • Config file test.ini
    [knockknock]
    sender=your_sender_type
    notification=True
    webhook_url=your_webhook_url
    channel=your_channel
    

    If notification is not set, it will be True by default. The config file must be started with the knockknock tag. And the sender determines the sender type. Other parameters are related to according sender function.

    opened by jhliu17 2
  • ConnectionResetError: [Errno 54] Connection reset by peer

    ConnectionResetError: [Errno 54] Connection reset by peer

    Hey, I have been trying to use the email functionality of knock-knock but I m facing this error. Could you please help me with this? Sharing the code and error below.

    Thanks! Bhavishya

    CODE

    imports..
    
    def train_model(X_train,y_train,X_test,y_test):
        classifier=SVC()
        classifier.fit(X_train,y_train)
        return f'Accuracy of the model: {(classifier.score(X_test, y_test))*100}%'
    
    @email_sender(recipient_emails=["[email protected]"],sender_email="[email protected]")
    def train_model_email_notify(X_train, y_train, X_test, y_test):
        return train_model(X_train,
                           y_train,
                           X_test,
                           y_test)
    
    
    wines=datasets.load_wine()
    x = wines['data']
    y = wines['target']
    
    
    X_train, X_test, y_train, y_test = train_test_split(x,y,test_size=0.2)
    mm = MinMaxScaler()
    X_train=mm.fit_transform(X_train)
    X_test=mm.fit_transform(X_test)
    train_model_email_notify(X_train, y_train, X_test, y_test)
    

    ERROR

    Traceback (most recent call last):
      File "/Users/bhavishya.pandit/PycharmProjects/ProjectTesting/test.py", line 30, in <module>
        train_model_email_notify(X_train, y_train, X_test, y_test)
      File "/Library/Python/3.8/site-packages/knockknock/email_sender.py", line 53, in wrapper_sender
        yag_sender.send(current_recipient, 'Training has started 🎬', contents)
      File "/Library/Python/3.8/site-packages/yagmail/sender.py", line 156, in send
        self.login()
      File "/Library/Python/3.8/site-packages/yagmail/sender.py", line 210, in login
        self._login(self.credentials)
      File "/Library/Python/3.8/site-packages/yagmail/sender.py", line 217, in _login
        self.smtp = self.connection(self.host, self.port, **self.kwargs)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/smtplib.py", line 1034, in __init__
        SMTP.__init__(self, host, port, local_hostname, timeout,
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/smtplib.py", line 253, in __init__
        (code, msg) = self.connect(host, port)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/smtplib.py", line 339, in connect
        self.sock = self._get_socket(host, port, self.timeout)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/smtplib.py", line 1042, in _get_socket
        new_socket = self.context.wrap_socket(new_socket,
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
        return self.sslsocket_class._create(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
        self.do_handshake()
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
        self._sslobj.do_handshake()
    ConnectionResetError: [Errno 54] Connection reset by peer
    
    opened by bhav09 0
  • Google discontinues

    Google discontinues "Allow Less Secure Apps"

    "To help keep your account secure, starting May 30, 2022, ​​Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password." -- https://support.google.com/accounts/answer/6010255?hl=en

    Will that affect knockknock's mail notification feature?

    opened by mcnoat 2
  • Fix raise import error in desktop

    Fix raise import error in desktop

    Currently, knockknock will only print the error message instead of raise an error when win10toast is not install on win10 desktop. This PR fixes it so that user will correctly see

    ImportError: Error: to use Windows Desktop Notifications, you need to install `win10toast` first. Please run `pip install win10toast==0.9`.
    

    instead of

    UnboundLocalError: local variable 'ToastNotifier' referenced before assignment
    
    opened by IncubatorShokuhou 0
  • keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends

    keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends

    Execution:

    knockknock email --recipient-emails [email protected] --sender-email [email protected] sleep 10
    

    Full error message:

    Traceback (most recent call last):
      File "/home/jovyan/conda/dsEnv/bin/knockknock", line 10, in <module>
        sys.exit(main())
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/knockknock/__main__.py", line 207, in main
        sender_func(**args)(run_func)()
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/knockknock/email_sender.py", line 53, in wrapper_sender
        yag_sender.send(current_recipient, 'Training has started 🎬', contents)
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/yagmail/sender.py", line 153, in send
        self.login()
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/yagmail/sender.py", line 206, in login
        self._login(self.credentials)
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/yagmail/sender.py", line 224, in _login
        password = self.handle_password(self.user, password)
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/yagmail/sender.py", line 230, in handle_password
        return handle_password(user, password)
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/yagmail/password.py", line 11, in handle_password
        password = keyring.get_password("yagmail", user)
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/keyring/core.py", line 55, in get_password
        return get_keyring().get_password(service_name, username)
      File "/home/jovyan/conda/dsEnv/lib/python3.8/site-packages/keyring/backends/fail.py", line 25, in get_password
        raise NoKeyringError(msg)
    keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, i
    nstall the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for d
    etails.
    

    I didn't find https://pypi.org/project/keyring helpful. Installing dbus-python didn't change the behavior and it's unclear which username and password keyrings is looking for. Are we talking email credentials username and password? What if you wanted to use a different knockknock service like Slack, would the keyrings username and password credentials specified need to be different?

    opened by lashmore 1
Owner
Hugging Face
The AI community building the future.
Hugging Face
Uber Open Source 1.6k Dec 31, 2022
Turns your machine learning code into microservices with web API, interactive GUI, and more.

Turns your machine learning code into microservices with web API, interactive GUI, and more.

Machine Learning Tooling 2.8k Jan 2, 2023
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.

Horovod Horovod is a distributed deep learning training framework for TensorFlow, Keras, PyTorch, and Apache MXNet. The goal of Horovod is to make dis

Horovod 12.9k Jan 7, 2023
DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective.

DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective. 10x Larger Models 10x Faster Trainin

Microsoft 8.4k Dec 30, 2022
PyTorch extensions for high performance and large scale training.

Description FairScale is a PyTorch extension library for high performance and large scale training on one or multiple machines/nodes. This library ext

Facebook Research 2k Dec 28, 2022
A high performance and generic framework for distributed DNN training

BytePS BytePS is a high performance and general distributed training framework. It supports TensorFlow, Keras, PyTorch, and MXNet, and can run on eith

Bytedance Inc. 3.3k Dec 28, 2022
Massively parallel self-organizing maps: accelerate training on multicore CPUs, GPUs, and clusters

Somoclu Somoclu is a massively parallel implementation of self-organizing maps. It exploits multicore CPUs, it is able to rely on MPI for distributing

Peter Wittek 239 Nov 10, 2022
TensorFlow Decision Forests (TF-DF) is a collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models.

TensorFlow Decision Forests (TF-DF) is a collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models. The library is a collection of Keras models and supports classification, regression and ranking. TF-DF is a TensorFlow wrapper around the Yggdrasil Decision Forests C++ libraries. Models trained with TF-DF are compatible with Yggdrasil Decision Forests' models, and vice versa.

null 538 Jan 1, 2023
DistML is a Ray extension library to support large-scale distributed ML training on heterogeneous multi-node multi-GPU clusters

DistML is a Ray extension library to support large-scale distributed ML training on heterogeneous multi-node multi-GPU clusters

null 27 Aug 19, 2022
WAGMA-SGD is a decentralized asynchronous SGD for distributed deep learning training based on model averaging.

WAGMA-SGD is a decentralized asynchronous SGD based on wait-avoiding group model averaging. The synchronization is relaxed by making the collectives externally-triggerable, namely, a collective can be initiated without requiring that all the processes enter it. It partially reduces the data within non-overlapping groups of process, improving the parallel scalability.

Shigang Li 6 Jun 18, 2022
A collection of interactive machine-learning experiments: 🏋️models training + 🎨models demo

?? Interactive Machine Learning experiments: ??️models training + ??models demo

Oleksii Trekhleb 1.4k Jan 6, 2023
Model factory is a ML training platform to help engineers to build ML models at scale

Model Factory Machine learning today is powering many businesses today, e.g., search engine, e-commerce, news or feed recommendation. Training high qu

null 16 Sep 23, 2022
MosaicML Composer contains a library of methods, and ways to compose them together for more efficient ML training

MosaicML Composer MosaicML Composer contains a library of methods, and ways to compose them together for more efficient ML training. We aim to ease th

MosaicML 2.8k Jan 6, 2023
SageMaker Python SDK is an open source library for training and deploying machine learning models on Amazon SageMaker.

SageMaker Python SDK SageMaker Python SDK is an open source library for training and deploying machine learning models on Amazon SageMaker. With the S

Amazon Web Services 1.8k Jan 1, 2023
Data from "Datamodels: Predicting Predictions with Training Data"

Data from "Datamodels: Predicting Predictions with Training Data" Here we provid

Madry Lab 51 Dec 9, 2022
AutoTabular automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications.

AutoTabular automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications. With just a few lines of code, you can train and deploy high-accuracy machine learning and deep learning models tabular data.

Robin 55 Dec 27, 2022
A Python library for choreographing your machine learning research.

A Python library for choreographing your machine learning research.

AI2 270 Jan 6, 2023
AutoTabular automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications.

AutoTabular AutoTabular automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications. With just

wenqi 2 Jun 26, 2022
ClearML - Auto-Magical Suite of tools to streamline your ML workflow. Experiment Manager, MLOps and Data-Management

ClearML - Auto-Magical Suite of tools to streamline your ML workflow Experiment Manager, MLOps and Data-Management ClearML Formerly known as Allegro T

ClearML 4k Jan 9, 2023