Unable to Retrieve Embedding Arrays From TensorBoard Logs
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python, pytorch
- Domain
- data-visualization
Research direction
Start by tracing PyTorch's SummaryWriter.add_embedding output and TensorBoard's EventAccumulator handling of the generated event files. Check the reported TensorBoard 2.16.2 behavior, including the tags returned by EventAccumulator.Tags(); done means establishing whether the arrays are supported there and documenting a reproducible retrieval path or the missing functionality.
Written by the indexing model from the issue text.
Description
I am encountering difficulties in retrieving embedding arrays that were logged using add_embedding from TensorBoard logs. I am unable to locate the actual embedding arrays. Below is a detailed description of the issue and the steps I have taken so far.
Steps to Reproduce
Logging Embeddings:
I used add_embedding to log embeddings in TensorBoard.
Example code for logging embeddings:
from torch.utils.tensorboard import SummaryWriter
import numpy as np
# Create a SummaryWriter
log_dir = 'logs/embedding_example'
writer = SummaryWriter(log_dir)
# Generate some dummy embeddings
embedding_data = np.random.randn(100, 64) # 100 items with 64-dim embeddings
metadata = [f'Label {i}' for i in range(100)]
# Write the embeddings
writer.add_embedding(mat=embedding_data, metadata=metadata, global_step=1)
writer.close()
Attempting to Retrieve Embeddings:
I tried using EventAccumulator to load and parse the event files but was unable to locate the embedding arrays.
Example code for extracting embeddings:
import os
import numpy as np
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
def extract_embeddings_from_log(log_dir):
event_acc = EventAccumulator(log_dir, size_guidance={'tensors': 0})
event_acc.Reload()
embeddings = {}
# Get tags for tensors (embeddings should be listed here)
tensor_tags = event_acc.Tags()
print(tensor_tags)
I would appreciate any guidance or suggestions on how to properly retrieve the embedding arrays logged using add_embedding. Specifically, I am looking for:
- Confirmation on whether add_embedding embeddings should be accessible through EventAccumulator.
- Corrections to my approach or alternative methods to extract the embeddings.
- Any additional information on the correct tags or structures to look for within the TensorBoard logs.
Environment Details
Framework: PyTorch
Logging Library: TensorBoard
TensorBoard Version: 2.16.2
Python Version: 3.10
Operating System: Ubuntu 22.04
Thank you for your assistance.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/tensorboard
-
node_repositories in WORKSPACE missing linux_ppc64le and linux_s390x entries for Node.js 18.20.8 Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
tensorflow/tensorboard#7140 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/tensorboard#7153 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
tensorflow/tensorboard#7137 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
tensorflow/tensorboard#7119 ·
-
Issue: TensorBoard wheels on PyPI fail with setuptools >81 due to deprecated pkg_resources removal Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/tensorboard#7107 · 2 comments · 7 reactions ·
All issues in tensorflow/tensorboard
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·