解决:tensorboard出现TensorFlow installation not found - running with reduced feature set

代码如下:

import torchvision.datasets
import torch
from torch.utils.tensorboard import SummaryWriter

# print(torch.cuda.is_available())

dataset_transform = torchvision.transforms.Compose([
    torchvision.transforms.ToTensor()
])

train_set = torchvision.datasets.CIFAR10(root="./dataset", train=True, transform=dataset_transform, download=True)
test_set = torchvision.datasets.CIFAR10(root="./dataset", train=False, transform=dataset_transform, download=True)

writer = SummaryWriter("CIFAR10")
for i in range(10):
    img, target = test_set[i]
    writer.add_image("test_set", img, i)

writer.close()
"""
then use:

tensorboard --logdir="D:\PycharmProjects\PyTorch\another_practice\CIFAR10"

to visit on web
"""

在这卡了半天,一直出现:

PS D:\PycharmProjects\PyTorch> tensorboard --logdir="CIFAR10"
TensorFlow installation not found - running with reduced feature set.
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.6.0 at http://localhost:6006/ (Press CTRL+C to quit)

解决办法:
改用绝对路径

 tensorboard --logdir="D:\PycharmProjects\PyTorch\another_practice\CIFAR10"

再次访问http://localhost:6006/就好了。

你可能感兴趣的:(pytorch,pytorch)