【问题标题】:TensorBoard: Tutorial Pytorch: module 'tensorflow._api.v2.io.gfile' has no attribute 'get_filesystem'TensorBoard:教程 Pytorch:模块 'tensorflow._api.v2.io.gfile' 没有属性 'get_filesystem'
【发布时间】:2020-07-30 08:30:08
【问题描述】:

我在运行本关于 Pytorch 和 TensorBoard with Embeddings https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html的教程时遇到问题

我收到了这条消息,

AttributeError                            Traceback (most recent call last)
<ipython-input-10-e0404d94b4cd> in <module>()
     22 writer.add_embedding(features,
     23                     metadata=class_labels,
---> 24                     label_img=images.unsqueeze(1))
     25 writer.close()

/usr/local/lib/python3.6/dist-packages/torch/utils/tensorboard/writer.py in add_embedding(self, mat, metadata, label_img, global_step, tag, metadata_header)
    779         save_path = os.path.join(self._get_file_writer().get_logdir(), subdir)
    780 
--> 781         fs = tf.io.gfile.get_filesystem(save_path)
    782         if fs.exists(save_path):
    783             if fs.isdir(save_path):

我可以看到投影仪

【问题讨论】:

    标签: pytorch google-colaboratory tensorboard


    【解决方案1】:

    试试这个

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

    【讨论】:

      猜你喜欢
      • 2020-06-29
      • 2022-01-12
      • 1970-01-01
      • 2021-09-24
      • 2020-10-03
      • 2021-10-08
      • 2021-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多