pytorch - TensorBoard:教程 Pytorch:模块 'tensorflow._api.v2.io.gfile' 没有属性 'get_filesystem'

标签 pytorch google-colaboratory tensorboard

我在运行有关带有嵌入的 Pytorch 和 TensorBoard 的教程时遇到问题 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):

我可以想象投影仪

最佳答案

试试这个

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

关于pytorch - TensorBoard:教程 Pytorch:模块 'tensorflow._api.v2.io.gfile' 没有属性 'get_filesystem',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61261451/

相关文章:

python - 什么是PyTorch中的运行损失以及如何计算

python - PyTorch 中神经网络推理时间的波动

python - NLTK 词汇分散图未在 Google Colab 上显示

python - Cupy OutOfMemoryError 尝试在内存映射模式下 cupy.load 较大尺寸的 .npy 文件时出现 Cupy OutOfMemoryError 错误,但 np.load 工作正常

python - 在 Tensorboard 中获取简单的绘图

python - 无法从 jupyter 启动 tensorboard

python - ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index) 抛出 IndexError : Target 42 is out of bounds

c++ - 自定义 C++ 扩展错误 : pasting “pybind11_init_” and “‘sigmoid’ ” does not give a valid preprocessing token

python - HTTP 错误 503 : Service Unavailable when trying to download MNIST data

tensorflow - 将 What if 工具与 xgboost 结合使用