question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedding Projector: "Color by" drop-down not showing up on multi-column .tsv

See original GitHub issue

Migrated from https://github.com/tensorflow/tensorflow/issues/9688

Describe the problem

Tensorboard does not display the Color By dropdown menu on multi-columnar data. Label by and search by displaying columns normally.

tensorboard dropdown issue

Source code / logs

Sample of metadata.tsv file:

Name	Genre
(Sandy) Alex G	Alternative/Indie Rock	
*NSYNC	Pop/Rock	
Acollective	Pop/Rock	
Ahmet Özhan	International	
Ahu	Club/Dance	
Alex Ferreira	Pop/Rock	
Alex Winston	Pop/Rock	
Ali Azimi	Pop/Rock	
Alphamama	Pop/Rock	
Amaryllis	International	
...
Yomo Toro	Latin
Youssou N'Dour	International
Zafra Negra	Latin
Zany	Electronic	
Zeki Müren	International
iSHi	Electronic	

Code to generate embeddings and metadata:

def list_to_tsv(filenames, metadata_dir):
    with open(os.path.join(metadata_dir,'metadata.tsv'), 'w') as tsvfile:
        writer = csv.writer(tsvfile, delimiter = "\t")
        for record in filenames:
            writer.writerow(record)

def save_down_tensors(tensor_dir, name_and_embedding):
    embeddings = [i[2] for i in name_and_embedding] 
    names = [[i[0],i[1]] for i in name_and_embedding]
    names.insert(0,['Name','Genre'])
    with tf.Session() as sess:
        embeddings_tf = tf.Variable(np.array(embeddings), name = "embeddings")
        tf.global_variables_initializer().run()
        # save the tensor down
        saver = tf.train.Saver(tf.global_variables())
        saver.save(sess, tensor_dir, 0)
        # associate metadata with the embedding
        summary_writer = tf.summary.FileWriter(tensor_dir)
        config = projector.ProjectorConfig()
        embedding = config.embeddings.add()
        embedding.tensor_name = embeddings_tf.name
        #save filenames to tsv
        list_to_tsv(names, metadata_dir)
        embedding.metadata_path = os.path.join(metadata_dir, "metadata.tsv")
        # save a configuration file that TensorBoard will read during startup.
        projector.visualize_embeddings(summary_writer, config)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

5reactions
danhpercommented, Sep 4, 2017

I ran into the same issue. After taking a look at the code, it seems that the maximum number of unique values for a column to be used in color-by is 50. I tried to increase the threshold and run the projector on my data with ~100 unique values (10000 points non-evenly distributed with respect to the color-by filter) and did not run in any performance issue on an average laptop. What would need to be done to be able to increase this threshold?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to specify tensorboard projector embedding colors
I'd like to be able to specify the colors tensorboard choses to display. I've looked through the source code but have had trouble...
Read more >
TensorBoard: Embedding Visualization · tfdocs - branyang
TensorBoard has a built-in visualizer, called the Embedding Projector, for interactive visualization and analysis of high-dimensional data like embeddings.
Read more >
Embedding projector
Color by. No color map Metadata count gradient. Use categorical coloring. For metadata fields that have many unique values we use a gradient...
Read more >
Omniscope User Guide
of the views not already showing. Each view has its own Toolbar and pick lists for selecting which fields (columns) to display. The...
Read more >
odate.pdf - The Open Digital Archaeology Textbook
as a way of serving and running the notebooks online in a browser. ... Finally, if you'd rather not read this as a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found