Tensorboard logging correctly but not displaying on localhost

username: Uyttendaele
cooked: <p>I am following the tutorial <a href="https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html#writing-to-tensorboard" rel="noopener nofollow ugc">Visualizing Models, Data, and Training with TensorBoard</a>, but cannot get TensorBoard to display on my localhost (getting a blank screen). Based on the warnings reported to the console (shown below), it appears this is a problem not with SummaryWriter but with the TensorBoard machinery creating the localhost.</p>
<p>I am running my code on a virtual environment through PyCharm equipped with Python 3.7, Torch 1.4.0, and TensorBoard 2.1.0. I also downloaded TensorFlow and TensorFlow GPU 2.1.0 just in case. I have CUDA 10.0 installed.</p>
<p>My code (identical to tutorial, but placed in main block due to issues with num_workers):</p>
<pre><code class="lang-auto">import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter


def main():
    # transforms
    transform = transforms.Compose(
        [transforms.ToTensor(),
        transforms.Normalize((0.5,), (0.5,))])

    # datasets
    trainset = torchvision.datasets.FashionMNIST('./data',
        download=True,
        train=True,
        transform=transform)
    testset = torchvision.datasets.FashionMNIST('./data',
        download=True,
        train=False,
        transform=transform)

    # dataloaders
    trainloader = torch.utils.data.DataLoader(trainset, batch_size=4,
                                            shuffle=True, num_workers=2)


    testloader = torch.utils.data.DataLoader(testset, batch_size=4,
                                            shuffle=False, num_workers=2)

    # constant for classes
    classes = ('T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',
            'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle Boot')

    net = Net()
    criterion = nn.CrossEntropyLoss()
    optimizer = optim.SGD(net.parameters(), lr=0.001, momentum=0.9)

    # default `log_dir` is "runs" - we'll be more specific here
    writer = SummaryWriter('runs/fashion_mnist_experiment_1')

    # get some random training images
    dataiter = iter(trainloader)
    images, labels = dataiter.next()

    # create grid of images
    img_grid = torchvision.utils.make_grid(images)

    # show images
    matplotlib_imshow(img_grid, one_channel=True)

    # write to tensorboard
    writer.add_image('four_fashion_mnist_images', img_grid)


# helper function to show an image
# (used in the `plot_classes_preds` function below)
def matplotlib_imshow(img, one_channel=False):
    if one_channel:
        img = img.mean(dim=0)
    img = img / 2 + 0.5     # unnormalize
    npimg = img.numpy()
    if one_channel:
        plt.imshow(npimg, cmap="Greys")
    else:
        plt.imshow(np.transpose(npimg, (1, 2, 0)))


class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(1, 6, 5)
        self.pool = nn.MaxPool2d(2, 2)
        self.conv2 = nn.Conv2d(6, 16, 5)
        self.fc1 = nn.Linear(16 * 4 * 4, 120)
        self.fc2 = nn.Linear(120, 84)
        self.fc3 = nn.Linear(84, 10)

    def forward(self, x):
        x = self.pool(F.relu(self.conv1(x)))
        x = self.pool(F.relu(self.conv2(x)))
        x = x.view(-1, 16 * 4 * 4)
        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))
        x = self.fc3(x)
        return x


if __name__ == '__main__':
    main()
</code></pre>
<p>Console:</p>
<pre><code class="lang-auto">(venv) C:\Users\xande\OneDrive - Personal\Documents\Information Pollution&gt;python TensorboardTest.py
2020-01-26 10:57:58.935034: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll

(venv) C:\Users\xande\OneDrive - Personal\Documents\Information Pollution&gt;tensorboard --logdir=runs
2020-01-26 10:58:36.091352: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-01-26 10:58:36.099596: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.1.0 at http://localhost:6006/ (Press CTRL+C to quit)
</code></pre>
<p>Localhost after running these commands (in Chrome, but also tried in other browsers):<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/a/2a0ba6f7dc0d3fa206f7fb68fa9aeaaedb76eda5.png" data-download-href="https://discuss.pytorch.org/uploads/default/2a0ba6f7dc0d3fa206f7fb68fa9aeaaedb76eda5" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a0ba6f7dc0d3fa206f7fb68fa9aeaaedb76eda5_2_517x310.png" alt="image" data-base62-sha1="5ZX19cO3H6rb4KPTp52MpZRg1lr" width="517" height="310" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a0ba6f7dc0d3fa206f7fb68fa9aeaaedb76eda5_2_517x310.png, https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a0ba6f7dc0d3fa206f7fb68fa9aeaaedb76eda5_2_775x465.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a0ba6f7dc0d3fa206f7fb68fa9aeaaedb76eda5_2_1034x620.png 2x" data-dominant-color="FCFDFD"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1733×1040 19.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Especially puzzling is the fact that my code seems to be able to open cudart64_101.dll, but the tensorboard call cannot. This seems like it’s likely the issue, but I am not even sure why my GPU should be involved at all right now, so I am stuck.</p>
<p>Any help would be appreciated!</p>

username: SiQube
cooked: <p>I am facing the same issue. Any help?</p>

username: sandeep_anand
cooked: <p>Hello Guys,</p>
<p>I an facing the same issue. Could you suggest any remarks.</p>
<p>Any help is appreciated.</p>

username: saluei
cooked: <aside class="quote no-group" data-username="Uyttendaele" data-post="1" data-topic="67705">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/u/dfb087/48.png" class="avatar"> Uyttendaele:</div>
<blockquote>
<p>TensorBoard 2.1.0.</p>
</blockquote>
</aside>
<p>I have same problem , I Install  TensorBoard version 1.15.0 and my problem solved</p>