tensorflow / tensorflow/tensorboard

Embedding visualization with eager execution

Open
#1,421 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

TensorBoard version: 1.10.0
OS: Linux Ubuntu 16.04.5 LTS
Python version: 2.7.12

I am using eager execution and I would like to visualize embeddings in TensorBoard. I use the following code to set up the visualization:

import tensorflow as tf
import tensorflow.contrib.eager as tfe
from tensorflow.contrib.tensorboard.plugins import projector
tf.enable_eager_execution()
tf.executing_eagerly()
self._writer = tf.contrib.summary.create_file_writer('path')
embedding_config = projector.ProjectorConfig()
embedding = embedding_config.embeddings.add()
embedding.tensor_name = self._word_embeddings.name
embedding.metadata_path = 'metadata.tsv'
projector.visualize_embeddings(self._writer, embedding_config)

where self._word_embeddings is my variable for the embeddings. However, when executing this script the following error is thrown:

File "/lib/python2.7/site-packages/tensorflow/contrib/tensorboard/plugins/projector/__init__.py", line 52, in visualize_embeddings
logdir = summary_writer.get_logdir()
AttributeError: 'SummaryWriter' object has no attribute 'get_logdir'

Might this be a bug? Any kind of help is greatly appreciated!

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

Start by reproducing the eager-execution setup using tf.contrib.summary.create_file_writer, projector.ProjectorConfig, and projector.visualize_embeddings. Inspect projector/init.py at visualize_embeddings, especially the get_logdir call, and compare the writer API used there with the writer created in the report. Done means the reported setup no longer raises the AttributeError and the embedding configuration is accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.