tensorboard colab tensorflow._api.v1.io.gfile' has no attribute 'get_filesystem
I am trying to use tensorboard on colab. I manage to make it work, but not for all commands. add_graph and add_scalar works, but when I tried to run add_embedding I am getting the following error:

AttributeError: module 'tensorflow._api.v1.io.gfile' has no attribute 'get_filesystem'


This is the relevant code (I think);

import os
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter(log_dir ="logs" )

images, labels = select_n_random(trainset.data, trainset.targets)
images = torch.from_numpy(images)
labels = torch.from_numpy(np.array(labels))
class_labels = [classes[lab] for lab in labels]

# log embeddings
features = images.reshape((-1,32*32*3))
writer.add_embedding(features,metadata=class_labels) #, label_img=images.unsqueeze(1))


The complete error is:

/tensorflow-1.15.0/python3.6/tensorflow_core/python/util/module_wrapper.py in __getattr__(self, name)
    191   def __getattr__(self, name):
    192     try:
--&gt; 193       attr = getattr(self._tfmw_wrapped_module, name)
    194     except AttributeError:
    195       if not self._tfmw_public_apis:

AttributeError: module 'tensorflow._api.v1.io.gfile' has no attribute 'get_filesystem'


using 


tensorflow-1.15.0 (tried to install 2.0 but had different issues)
Python 3.6.9
torch 1.4.0
tensorboard 2.1.1 (tried also with 1.15.0 but same issue)


I also tried using the "magic" command:

%load_ext tensorboard
%tensorboard --logdir logs


But I wasn't able to make it work that way (other issues). 

Any suggestions how can I make it work?

For me, this fixed the problem:

import tensorflow as tf
import tensorboard as tb
tf.io.gfile = tb.compat.tensorflow_stub.io.gfile

