Embedding visualization with eager execution
See original GitHub issueTensorBoard 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!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
This issue is more relevant now because TF2.0 removes
SummaryWriter
, making the projector impossible to use without a workaround.@maximilianmozes Can you access the embedded vectors as a numpy array? If so, I think tensorboardX might do the trick.