use of add_embedding as logger.experiment.add_embedding
🐛 Bug
    def validation_step(self, batch, batch_idx):
        x, y = batch
        mu, logvar = self.encode(x.view(-1, 784))
        z = self.reparameterize(mu, logvar)
        x_rec =self(z)
        val_loss = self.loss_function(x_rec, x, mu, logvar)
    
        if batch_idx == 0:
            n = min(x.size(0), 8)
            comparison = torch.cat([x[:n],
                                x_rec.view(args.batch_size, 1, 28, 28)[:n]])
            # self.logger.experiment.add_image('images_loop',comparison,0)
            grid = torchvision.utils.make_grid(comparison)
            self.logger.experiment.add_image('images1', grid, 0)
            self.logger.experiment.add_embedding(mu, metadata=y.tolist(), label_img=x, tag='embeddings_mu')

The console output:
Validation sanity check: 0it [00:00, ?it/s]Traceback (most recent call last):
  File "/home/maulik/Documents/Tools/Learning/Deep_learning/Pytorch_lightning/vae.py", line 164, in <module>
    trainer.fit(vae, train_loader, val_loader)
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 440, in fit
    results = self.accelerator_backend.train()
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/accelerators/gpu_accelerator.py", line 54, in train
    results = self.train_or_test()
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py", line 66, in train_or_test
    results = self.trainer.train()
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 462, in train
    self.run_sanity_check(self.get_model())
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 648, in run_sanity_check
    _, eval_results = self.run_evaluation(test_mode=False, max_batches=self.num_sanity_val_batches)
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 568, in run_evaluation
    output = self.evaluation_loop.evaluation_step(test_mode, batch, batch_idx, dataloader_idx)
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 171, in evaluation_step
    output = self.trainer.accelerator_backend.validation_step(args)
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/accelerators/gpu_accelerator.py", line 78, in validation_step
    output = self.__validation_step(args)
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/pytorch_lightning/accelerators/gpu_accelerator.py", line 86, in __validation_step
    output = self.trainer.model.validation_step(*args)
  File "/home/maulik/Documents/Tools/Learning/Deep_learning/Pytorch_lightning/vae.py", line 84, in validation_step
    self.logger.experiment.add_embedding(mu, metadata=y.tolist(), label_img=x, tag='embeddings_mu')
  File "/home/maulik/anaconda3/envs/ml/lib/python3.8/site-packages/torch/utils/tensorboard/writer.py", line 788, in add_embedding
    fs = tf.io.gfile.get_filesystem(save_path)
AttributeError: module 'tensorflow._api.v2.io.gfile' has no attribute 'get_filesystem'

Workaround
30966-pytorch-issue
Please fix.
It works sometimes by adding
import tensorflow as tf
import tensorboard as tb
tf.io.gfile = tb.compat.tensorflow_stub.io.gfile

Thanks
Maulik