图像分类数据集

http://zh-v2.d2l.ai/chapter_linear-networks/image-classification-dataset.html

1.Yes. With the batch_size 1, it took me 37.22 seconds to read the dataset.
2.Pass.
3.e.g. ImageNet, Qmnist and Kinetics-400.

It is so confusing that you answered the question in English, but you didn’t read the English version directly.
https://d2l.ai/

我本来觉得阅读中文版速度会快一些,但是目前看来中文版的翻译有些地方还是有点晦涩。可能之后转向看英文版?

读取性能随batch_size大小的影响图。可以看到256确实是个很合理的batch_size。
Figure_1

3 Likes

mnist_train[0][0].shape
I want to know what the numbers in the two square brackets represent. Can someone help me?

It’s the index of the tensor, which is line 0 col 0.
mnist_train[0][0].shape #this line is used to print the shape of a typical tensor in the data set(which is train set in this case).
The output is torch.Size([1, 28, 28]) .Represents ([channal,height,width]) .
It’s a grayscale image, so it’s channal will be 1.

train_iter = data.DataLoader(mnist_train, batch_size, shuffle=True,
num_workers=get_dataloader_workers())

运行到这段程序时,一旦 num_workers>0就会报错,请问如何解决?
使用if name == ‘main’:也不行