Skip to content

Instantly share code, notes, and snippets.

@Aldhanekaa
Created October 10, 2023 04:13
Show Gist options
  • Save Aldhanekaa/7bad79725520a85e934ad6ec22ea16b1 to your computer and use it in GitHub Desktop.
Save Aldhanekaa/7bad79725520a85e934ad6ec22ea16b1 to your computer and use it in GitHub Desktop.
figure = plt.figure(figsize=(12,12))
cols, rows = 4,8
for batchSize, (X, y) in enumerate(train_dataloader):
# X = X.transpose()
batch = y.shape[0]
for i in range(batch):
img, label = X[i], y[i]
# print(img.shape)
img.to(device)
# img = img.transpose(3,2)
figure.add_subplot(rows, cols, i+1)
# print(labels.iloc[label].char)
plt.title(f" {label}")
plt.axis("off")
plt.imshow(img.squeeze(), cmap="gray")
# for i
break
plt.show()
@Aldhanekaa
Copy link
Author

pytorch dataloader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment