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
Intent parsing and slot filling in PyTorch with seq2seq + attention

PyTorch Seq2Seq Intent Parsing Reframing intent parsing as a human - machine translation task. Work in progress successor to torch-seq2seq-intent-pars

Sean Robertson 160 Jan 07, 2023
Semantic Segmentation in Pytorch. Network include: FCN、FCN_ResNet、SegNet、UNet、BiSeNet、BiSeNetV2、PSPNet、DeepLabv3_plus、 HRNet、DDRNet

🚀 If it helps you, click a star! ⭐ Update log 2020.12.10 Project structure adjustment, the previous code has been deleted, the adjustment will be re-

Deeachain 269 Jan 04, 2023
Unsupervised Learning of Probably Symmetric Deformable 3D Objects from Images in the Wild

Unsupervised Learning of Probably Symmetric Deformable 3D Objects from Images in the Wild

1.1k Jan 03, 2023
CUDA Python Low-level Bindings

CUDA Python Low-level Bindings

NVIDIA Corporation 529 Jan 03, 2023
Code for the paper: "On the Bottleneck of Graph Neural Networks and Its Practical Implications"

On the Bottleneck of Graph Neural Networks and its Practical Implications This is the official implementation of the paper: On the Bottleneck of Graph

75 Dec 22, 2022
Code for testing various M1 Chip benchmarks with TensorFlow.

M1, M1 Pro, M1 Max Machine Learning Speed Test Comparison This repo contains some sample code to benchmark the new M1 MacBooks (M1 Pro and M1 Max) aga

Daniel Bourke 348 Jan 04, 2023
[NeurIPS 2021] Towards Better Understanding of Training Certifiably Robust Models against Adversarial Examples | ⛰️⚠️

Towards Better Understanding of Training Certifiably Robust Models against Adversarial Examples This repository is the official implementation of "Tow

Sungyoon Lee 4 Jul 12, 2022
[CVPR 2022] Back To Reality: Weak-supervised 3D Object Detection with Shape-guided Label Enhancement

Back To Reality: Weak-supervised 3D Object Detection with Shape-guided Label Enhancement Announcement 🔥 We have not tested the code yet. We will fini

Xiuwei Xu 7 Oct 30, 2022
Unified learning approach for egocentric hand gesture recognition and fingertip detection

Unified Gesture Recognition and Fingertip Detection A unified convolutional neural network (CNN) algorithm for both hand gesture recognition and finge

Mohammad 227 Dec 25, 2022
Demo for the paper "Overlap-aware low-latency online speaker diarization based on end-to-end local segmentation"

Streaming speaker diarization Overlap-aware low-latency online speaker diarization based on end-to-end local segmentation by Juan Manuel Coria, HervĂŠ

Juanma Coria 187 Jan 06, 2023
Re-implementation of the vector capsule with dynamic routing

VectorCapsule Re-implementation of the vector capsule with dynamic routing We implement the vector capsule and dynamic routing via graph neural networ

ZhenchaoTang 10 Feb 10, 2022
Simple streamlit app to demonstrate HERE Tour Planning

Table of Contents About the Project Built With Getting Started Prerequisites Installation Usage Roadmap Contributing License Acknowledgements About Th

Amol 8 Sep 05, 2022
This program generates a random 12 digit/character password (upper and lowercase) and stores it in a file along with your username and app/website.

PasswordGeneratorAndVault This program generates a random 12 digit/character password (upper and lowercase) and stores it in a file along with your us

Chris 1 Feb 26, 2022
Auto-Encoding Score Distribution Regression for Action Quality Assessment

DAE-AQA It is an open source program reference to paper Auto-Encoding Score Distribution Regression for Action Quality Assessment. 1.Introduction DAE

13 Nov 16, 2022
Facial detection, landmark tracking and expression transfer library for Windows, Linux and Mac

Welcome to the CSIRO Face Analysis SDK. Documentation for the SDK can be found in doc/documentation.html. All code in this SDK is provided according t

Luiz Carlos Vieira 7 Jul 16, 2020
A TensorFlow implementation of the Mnemonic Descent Method.

MDM A Tensorflow implementation of the Mnemonic Descent Method. Mnemonic Descent Method: A recurrent process applied for end-to-end face alignment G.

123 Oct 07, 2022
SAAVN - Sound Adversarial Audio-Visual Navigation,ICLR2022 (In PyTorch)

SAAVN SAAVN Code release for paper "Sound Adversarial Audio-Visual Navigation,IC

YinfengYu 10 Aug 30, 2022
Unofficial implementation of Pix2SEQ

Unofficial-Pix2seq: A Language Modeling Framework for Object Detection Unofficial implementation of Pix2SEQ. Please use this code with causion. Many i

159 Dec 12, 2022
A simple root calculater for python

Root A simple root calculater Usage/Examples python3 root.py 9 3 4 # Order: number - grid - number of decimals # Output: 2.08

Reza Hosseinzadeh 5 Feb 10, 2022
Location-Sensitive Visual Recognition with Cross-IOU Loss

The trained models are temporarily unavailable, but you can train the code using reasonable computational resource. Location-Sensitive Visual Recognit

Kaiwen Duan 146 Dec 25, 2022