tensorflow / tensorflow/tensorboard

Tensorboard.dev , Implement threading & kill prompt this to make it usable & awesome

Open
#4,476 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core:backend core:frontend tbdev type:feature
Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

Great initiative with Tensorboard.dev

Here are two crucial features that I believe drastically would increase user experience and over usage of the service.
Due to my miserable & dirty python coding ill leave the implementation to the pros, happy to assist.

1. Utilize threading to run the function as a daemon

Use threading, Run daemon in the background on an interval that looks for new data, and ship it to the remote.
I did some tests myself running the following code and it did work well, some tweaks and it should fulfill the purpose

Suggested param

  • Run in daemon mode
  • Interval to check for new data
import threading
import time
import ftplib

class ThreadingExample(object):
    """ 
    Threading example class
    The run() method will be started and it will run in the background
    until the application exits.
    """

    def __init__(self, interval=5):
        """ Constructor
        :type interval: int
        :param interval: Check interval, in seconds
        """
        self.interval = interval

        thread = threading.Thread(target=self.run, args=())
        thread.daemon = True  # Daemonize thread
        thread.start()  # Start the execution

    def run(self):
        """ Method that runs forever """
        while True:
            # Do something
            print('Multithreading deamon running ..')
            session = ftplib.FTP(
                'ftp.dlptest.com', 'dlpuser@dlptest.com', 'eUj8GeW55SvYaswqUyDSm5v6N')       
            file = open('/') # file to send
            session.storbinary('STOR best_model.zip', file) # send the file
            file.close() # close file and FTP
            session.quit()
            print('file uploaded')
            time.sleep(self.interval)

            # Code for running
            example = ThreadingExample()
            time.sleep(3)
            print('Checkpoint')
            time.sleep(2)
            print('Bye')

2. Get around the (Yes/No) prompt in Jupyter

Currently, when running the package it will prompt for yes/no.
While this is easy to get around in Colab or Jupyter lab with access to the terminal it does get quite tricky when running a notebook on Jupyter etc. Maybe there is a way around it, I did not find any easy solution. If there is, include it in documentation.

The end

Hope it makes sense, to improve the user experience in the ML/AI field is crucial to driving adaptation short term & innovation longterm. Tensorboard.dev is a great initiative and it should not fall short of its finish line.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files or tests; start by locating the TensorBoard.dev upload command and the yes/no prompt path used from Jupyter. Clarify whether daemon uploads with an interval and noninteractive prompt handling are both in scope, then define tests for background operation, interval handling, and prompt-free use.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
developer-experience, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.