Interaction with the insertion of metadata into tensocardboard

I am using the tflearn wrapper on top of the tensor stream to create a model and want to add metadata (labels) to the render visualization. Is there any way to associate the metadata.tsv file with the saved checkpoint after it was launched?

I created the projector_config.pbtxt file in the logdir of the checkpoint summaries, where metadata.tsv is in the same folder. The configuration looks like this:

embeddings {
  tensor_name: "Embedding/W"
  metadata_path: "C:/tmp/tflearn_logs/shallow_lstm/"
}

and was created using code from documents - https://www.tensorflow.org/how_tos/embedding_viz/

I commented on the tf.Session part in the hope of creating a metadata link without having to do it directly in the Session object, but I'm not sure if this is possible.

from tensorflow.contrib.tensorboard.plugins import projector
#with tf.Session() as sess:
config = projector.ProjectorConfig()
# One can add multiple embeddings.
embedding = config.embeddings.add()
embedding.tensor_name = 'Embedding/W'
# Link this tensor to its metadata file (e.g. labels).
embedding.metadata_path = 'C:/tmp/tflearn_logs/shallow_lstm/'
# Saves a config file that TensorBoard will read during startup.
projector.visualize_embeddings(tf.summary.FileWriter('/tmp/tflearn_logs/shallow_lstm/'), config)

. . ?

Embed visualization

+4
3

, :)

, , , 3 :

  • , , ckeckpoint ckp_dir;
  • projector_config.pbtxt metadata.tsv ckp_dir;
  • tensorboard --logdir=ckp_dir

projector_config.pbtxt:

    embeddings {
      tensor_name: "embedding_name"
      metadata_path: "metatdata.tsv"
    }

, metadata.tsv. tf.Session() , sess.run('embedding_name:0'). projector_config.pbtxt tensor_name: "embedding_name".

, metadata_path projector_config.pbtxt, , projector_config.pbtxt metadata.tsv . , . , .

,

+1

projector_config.pbtxt:

embeddings {
  tensor_name: "Embedding/W"
  metadata_path: "$LOGDIR/metadata.tsv"
}

, $LOGDIR - , tensorboard --logdir=$LOGDIR ; (, , C:/..). metadata_path.

, .


, word2vec tutorial. , projector_config.pbtxt :

embeddings {
  tensor_name: "w_in"
  metadata_path: "$LOGDIR/vocab.txt"
}

save_vocab , unicode hex.

+1

. [EDIT:] , , . "" , , --logdir, , - , . , , dir -logdir, .

, , , , - ...

-1

Source: https://habr.com/ru/post/1667075/


All Articles