plt.show() not showing images
My code is as follow:
import torch
import torchvision
import torchvision.transforms as transforms

import numpy
import matplotlib
import matplotlib.pyplot as plt


torch.set_printoptions(linewidth=120)

train_set = torchvision.datasets.FashionMNIST(
    root='./data/FashionMNIST',
    train=True,
    download=True,
    transform=transforms.Compose([
        transforms.ToTensor()
    ])
) 

train_loader = torch.utils.data.DataLoader(
    train_set, batch_size=10
)

sample = next(iter(train_set))
image, label = sample

plt.imshow(image.squeeze(), cmap='gray')
plt.show()
print(f&quot;label:{label}&quot;)

I try to print an image via matploblib.pylot but nothing happens.
Plus, I'm doing this on my linux server, while the same code works quite well locally on my vscode.

As an alternative to viewing your matplolib window remotely, you can always save your plot as an image file and copy it to your local machine. This is as simple as using plt.savefig
plt.save(f'label:{label}.png')

