omoindrot / tensorflow-triplet-loss

Implementation of triplet loss in TensorFlow
https://omoindrot.github.io/triplet-loss
MIT License
1.12k stars 284 forks source link

Produce the visual embedding #21

Open alexandreduhamel opened 5 years ago

alexandreduhamel commented 5 years ago

Hi, thanks for sharing your project,

I would like to know how to produce visual embeddings like shown in project page. I guessed that after execute python visualize_embeddings.py --model_dir experiments/base_model, I could see it in Tensorboard at projector's tab, but I get hang on computing PCA.

omoindrot commented 5 years ago

Maybe you have too many images and TensorBoard will take forever to run PCA?

Try a minimal example with maybe two images.

alexandreduhamel commented 5 years ago

Even with 2 images(MNIST dataset, dimension 64), this still hang on computing PCA.

omoindrot commented 5 years ago

Not sure what happens then.

Maybe check stackoverflow: https://stackoverflow.com/questions/44054907/tensorfboard-embeddings-hangs-with-computing-pca

mharshe commented 5 years ago

Even with 2 images(MNIST dataset, dimension 64), this still hang on computing PCA.

There was a bug in (or until) tensorboard 1.11 which prevented the embeddings from being plotted. https://github.com/tensorflow/tensorboard/issues/1480 The bug is fixed for v1.12 or if you prefer to stick to earlier version of tensorboard, then patch it with this patch https://github.com/tensorflow/tensorboard/pull/1481 and compile tensorboard yourself. I had the same problem.