faris-k / fastsiam-wafers

Self-Supervised Representation Learning of Wafer Maps with FastSiam
MIT License
6 stars 0 forks source link

tensorboard embedding projector not working #1

Closed sgbaird closed 1 year ago

sgbaird commented 1 year ago
faris-k commented 1 year ago

@sgbaird psssst check this out

The issue

Access to sprite image was blocked by CORS policy

image

The fix

Epic googling of "TensorBoard projector CORS policy" leads to a fix here

Broken config file:

{
  "embeddings": [
    {
      "tensorName": "Wafer Embeddings",
      "tensorShape": [
        623,
        512
      ],
      "tensorPath": "https://raw.githubusercontent.com/faris-k/fastsiam-wafers/main/embedding_projector/feature_vecs.tsv",
      "metadataPath": "https://raw.githubusercontent.com/faris-k/fastsiam-wafers/main/embedding_projector/failure_types.tsv",
      "sprite": {
        "imagePath": "https://github.com/faris-k/fastsiam-wafers/blob/main/embedding_projector/sprite.png?raw=true",
        "singleImageDim": [
          128,
          128
        ]
      }
    }
  ]
}

Fixed config file (literally one line, the imagePath 🙃)

{
  "embeddings": [
    {
      "tensorName": "Wafer Embeddings",
      "tensorShape": [
        623,
        512
      ],
      "tensorPath": "https://raw.githubusercontent.com/faris-k/fastsiam-wafers/main/embedding_projector/feature_vecs.tsv",
      "metadataPath": "https://raw.githubusercontent.com/faris-k/fastsiam-wafers/main/embedding_projector/failure_types.tsv",
      "sprite": {
        "imagePath": "https://raw.githubusercontent.com/faris-k/fastsiam-wafers/main/embedding_projector/sprite.png",
        "singleImageDim": [
          128,
          128
        ]
      }
    }
  ]
}

TL;DR

Make sure everything in your config file points to githubusercontent.com instead of github.com or something else.