Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snehankekre/streamlit-tensorboard
Streamlit component for TensorBoard, TensorFlow's visualization toolkit
https://github.com/snehankekre/streamlit-tensorboard
streamlit tensorboard tensorflow
Last synced: 4 months ago
JSON representation
Streamlit component for TensorBoard, TensorFlow's visualization toolkit
- Host: GitHub
- URL: https://github.com/snehankekre/streamlit-tensorboard
- Owner: snehankekre
- License: mit
- Created: 2021-06-13T12:39:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-08T11:38:25.000Z (about 3 years ago)
- Last Synced: 2024-09-30T09:02:48.591Z (4 months ago)
- Topics: streamlit, tensorboard, tensorflow
- Language: Python
- Homepage: https://pypi.org/project/streamlit-tensorboard/
- Size: 170 KB
- Stars: 40
- Watchers: 5
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# streamlit-tensorboard
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](http://snehankekre.com:8501/)
This is a work-in-progress, providing a function to embed [TensorBoard](https://www.tensorflow.org/tensorboard), TensorFlow's visualization toolkit, in Streamlit apps.
## Installation :balloon:
`pip install --upgrade streamlit-tensorboard`
## Example Usage :computer:
```python
import streamlit as st
from streamlit_tensorboard import st_tensorboard
import tensorflow as tfimport datetime
import randommnist = 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.0def 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](https://github.com/snehankekre/streamlit-tensorboard/blob/master/_static/st-tensorboard-example.png)
## Contributing :hammer_and_wrench:
Please file a new [GitHub issue](https://github.com/snehankekre/streamlit-tensorboard/issues) (if one doesn't already exist) for bugs, feature requests, suggestions for improvements, etc. If you have solutions to any [open issues](https://github.com/snehankekre/streamlit-tensorboard/issues), feel free to open a [Pull Request](https://github.com/snehankekre/streamlit-tensorboard/pulls)!
## Supported Platforms
1. Ubuntu
2. Debian GNU/Linux
3. macOS (⚠️ unverified)This component will not work on [Streamlit Cloud](https://share.streamlit.io/). Due to security reasons, Streamlit Cloud does not allow users expose ports (as required by streamlit-tensorboard).