Streamlit component for TensorBoard, TensorFlow's visualization toolkit

Overview

streamlit-tensorboard

Streamlit App

This is a work-in-progress, providing a function to embed TensorBoard, TensorFlow's visualization toolkit, in Streamlit apps.

Installation 🎈

pip install --upgrade streamlit-tensorboard

Example Usage 💻

import streamlit as st
from streamlit_tensorboard import st_tensorboard
import tensorflow as tf

import datetime
import random

mnist = tf.keras.datasets.mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

def create_model():
    return tf.keras.models.Sequential(
        [
            tf.keras.layers.Flatten(input_shape=(28, 28)),
            tf.keras.layers.Dense(512, activation="relu"),
            tf.keras.layers.Dropout(0.2),
            tf.keras.layers.Dense(10, activation="softmax"),
        ]
    )

model = create_model()
model.compile(
    optimizer="adam", loss="sparse_categorical_crossentropy", metrics=["accuracy"]
)

logdir = "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=logdir, histogram_freq=1)

model.fit(
    x=x_train,
    y=y_train,
    epochs=5,
    validation_data=(x_test, y_test),
    callbacks=[tensorboard_callback],
)

# Start TensorBoard
st_tensorboard(logdir=logdir, port=6006, width=1080)

st_tensorboard

Contributing 🛠️

Please file a new GitHub issue (if one doesn't already exist) for bugs, feature requests, suggestions for improvements, etc. If you have solutions to any open issues, feel free to open a Pull Request!

Supported Platforms

  1. Ubuntu
  2. Debian GNU/Linux
  3. macOS ( ⚠️ unverified)

Windows is currently not supported. PRs for added Windows support are welcome as fix to this issue.

Comments
  • Fixing Windows support by changing logdir to POSIX format

    Fixing Windows support by changing logdir to POSIX format

    Using pathlib to change the logdir path to POSIX format. The change would make the shlex.split work properly, thus making it work on Windows, and it will still work on Linux.

    opened by ansonnn07 2
  • Refuses to connect on Streamlit sharing

    Refuses to connect on Streamlit sharing

    image

    The issue has to do with network permissions on the remote host. Port 6006 should be opened on the remote host and incoming/outgoing connections should be allowed at remote host:6006.

    opened by snehankekre 1
  • Works on MacOS

    Works on MacOS

    I read in the readme that Streamlit-tensorboard is unverified on macOS. Upon trying, I noticed a delay in the TensorBoard loading. Opening the port 6006 on another tab, helped solve this issue of the delay.

    opened by 259mit 0
  • Support several comma-separated paths in logdir

    Support several comma-separated paths in logdir

    Hi @snehankekre Many thanks for the contribution. Just wondering whether it would be possible to support passing to the logdir argument of st_tensorboard a list of comma-separated paths to render several specific experiments, e.g. in the original tensorboard call you can specify it as follows:

    tensorboard --logdir=name1:/path/to/logs/1,name2:/path/to/logs/2

    Regards

    enhancement help wanted good first issue 
    opened by davidjimenezphd 1
  • Reuse TensorBoard on port {port} (pid {pid}) if opened previously

    Reuse TensorBoard on port {port} (pid {pid}) if opened previously

    Each widget interaction with Streamlitt causes the script to rerun from top to bottom. This execution model leads to the creation of a new TensorBoard server for every interaction and new connection to the Streamlit app.

    Desired behavior:

    1. If a TensorBoard server is running, connect to it instead of opening a new one.
    2. Reuse cached connection for viewers of the app. Do not open a new TensorBoard for each viewer.
    bug help wanted 
    opened by snehankekre 3
Releases(0.0.2)
Owner
Snehan Kekre
Documentation Writer @streamlit. Formerly, @Coursera.
Snehan Kekre
Pytorch library for end-to-end transformer models training and serving

Pytorch library for end-to-end transformer models training and serving

Mikhail Grankin 768 Jan 01, 2023
Sketch-Based 3D Exploration with Stacked Generative Adversarial Networks

pix2vox [Demonstration video] Sketch-Based 3D Exploration with Stacked Generative Adversarial Networks. Generated samples Single-category generation M

Takumi Moriya 232 Nov 14, 2022
This is the repository for paper NEEDLE: Towards Non-invertible Backdoor Attack to Deep Learning Models.

This is the repository for paper NEEDLE: Towards Non-invertible Backdoor Attack to Deep Learning Models.

1 Oct 25, 2021
The PASS dataset: pretrained models and how to get the data - PASS: Pictures without humAns for Self-Supervised Pretraining

The PASS dataset: pretrained models and how to get the data - PASS: Pictures without humAns for Self-Supervised Pretraining

Yuki M. Asano 249 Dec 22, 2022
Caffe-like explicit model constructor. C(onfig)Model

cmodel Caffe-like explicit model constructor. C(onfig)Model Installation pip install git+https://github.com/bonlime/cmodel Usage In order to allow usi

1 Feb 18, 2022
MIMIC Code Repository: Code shared by the research community for the MIMIC-III database

MIMIC Code Repository The MIMIC Code Repository is intended to be a central hub for sharing, refining, and reusing code used for analysis of the MIMIC

MIT Laboratory for Computational Physiology 1.8k Dec 26, 2022
Training BERT with Compute/Time (Academic) Budget

Training BERT with Compute/Time (Academic) Budget This repository contains scripts for pre-training and finetuning BERT-like models with limited time

Intel Labs 263 Jan 07, 2023
SwinIR: Image Restoration Using Swin Transformer

SwinIR: Image Restoration Using Swin Transformer This repository is the official PyTorch implementation of SwinIR: Image Restoration Using Shifted Win

Jingyun Liang 2.4k Jan 08, 2023
LocUNet is a deep learning method to localize a UE based solely on the reported signal strengths from a set of BSs.

LocUNet LocUNet is a deep learning method to localize a UE based solely on the reported signal strengths from a set of BSs. The method utilizes accura

4 Oct 05, 2022
Codebase for "ProtoAttend: Attention-Based Prototypical Learning."

Codebase for "ProtoAttend: Attention-Based Prototypical Learning." Authors: Sercan O. Arik and Tomas Pfister Paper: Sercan O. Arik and Tomas Pfister,

47 2 May 17, 2022
Official public repository of paper "Intention Adaptive Graph Neural Network for Category-Aware Session-Based Recommendation"

Intention Adaptive Graph Neural Network (IAGNN) This is the official repository of paper Intention Adaptive Graph Neural Network for Category-Aware Se

9 Nov 22, 2022
Employee-Managment - Company employee registration software in the face recognition system

Employee-Managment Company employee registration software in the face recognitio

Alireza Kiaeipour 7 Jul 10, 2022
StackNet is a computational, scalable and analytical Meta modelling framework

StackNet This repository contains StackNet Meta modelling methodology (and software) which is part of my work as a PhD Student in the computer science

Marios Michailidis 1.3k Dec 15, 2022
GANsformer: Generative Adversarial Transformers Drew A

GANformer: Generative Adversarial Transformers Drew A. Hudson* & C. Lawrence Zitnick Update: We released the new GANformer2 paper! *I wish to thank Ch

Drew Arad Hudson 1.2k Jan 02, 2023
Measure WWjj polarization fraction

WlWl Polarization Measure WWjj polarization fraction Paper: arXiv:2109.09924 Notice: This code can only be used for the inference process, if you want

4 Apr 10, 2022
A TensorFlow 2.x implementation of Masked Autoencoders Are Scalable Vision Learners

Masked Autoencoders Are Scalable Vision Learners A TensorFlow implementation of Masked Autoencoders Are Scalable Vision Learners [1]. Our implementati

Aritra Roy Gosthipaty 59 Dec 10, 2022
Pytorch implementation of face attention network

Face Attention Network Pytorch implementation of face attention network as described in Face Attention Network: An Effective Face Detector for the Occ

Hooks 312 Dec 09, 2022
sssegmentation is a general framework for our research on strongly supervised semantic segmentation.

sssegmentation is a general framework for our research on strongly supervised semantic segmentation.

445 Jan 02, 2023
An implementation of the "Attention is all you need" paper without extra bells and whistles, or difficult syntax

Simple Transformer An implementation of the "Attention is all you need" paper without extra bells and whistles, or difficult syntax. Note: The only ex

29 Jun 16, 2022
Freecodecamp Scientific Computing with Python Certification; Solution for Challenge 2: Time Calculator

Assignment Write a function named add_time that takes in two required parameters and one optional parameter: a start time in the 12-hour clock format

Hellen Namulinda 0 Feb 26, 2022