Last active
November 5, 2019 13:56
-
-
Save tkshnkmr/ba492ec5691d59fe3dd4d5c341e31b9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data loader | |
batch_size = 1 | |
num_workers = 4 | |
data_loader = torch.utils.data.DataLoader(my_dataset, | |
batch_size=batch_size, | |
shuffle=False, | |
num_workers=num_workers | |
) | |
import numpy as np | |
import matplotlib.pyplot as plt | |
for images, labels in data_loader: | |
# image shape is [batch_size, 3 (due to RGB), height, width] | |
img = transforms.ToPILImage()(images[0]) | |
plt.imshow(img) | |
plt.show() | |
print(labels) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment