Study iterator loading time vs number of workers. It shows when number of workers (parallel process)=4 the loading time is minimum
mnist_train = gluon.data.vision.FashionMNIST(train=True)
mnist_test = gluon.data.vision.FashionMNIST(train=False)
为什么 train为True的时候下载60000个
而train为False时就下载了10000个呢? 这个参数在哪里定义的啊
train=True, train=False, 这个参数传进去可能就对应下载的多少吧,训练集肯定要多点,测试集少点
show_images(X.reshape(18, 28, 28), 2, 9, titles=get_fashion_mnist_labels(y));
这句里面的分号是啥意思?
分号代表不输出show_images这个函数的返回值
为什么X的shape是32 1 64 64
在load_data_fashion_mnist函数中,trans = transforms.Compose(trans)这个语句的作用是什么呢?
RuntimeError: DataLoader worker (…) exited unexpectedly
Solution 1:
train_iter = data.DataLoader(mnist_train, batch_size, shuffle=True,
num_workers=0)
Solution 2:
if __name__ == '__main__':
train_iter = data.DataLoader(mnist_train, batch_size, shuffle=True,
num_workers=get_dataloader_workers())
timer = d2l.Timer()
for X, y in train_iter:
continue
print(f'{timer.stop():.2f} sec')
mnist_train[i][0] 代表第i个样本的图片
mnist_train[i][1] 代表第i个样本的label
Thank you,solve my problem.
请问下载数据集时进度条不动怎么办
Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz
Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz to …/data\FashionMNIST\raw\train-images-idx3-ubyte.gz
0%| | 0/26421880 [00:00<?, ?it/s]
因为你没…/路径的权限吧,尝试多创建一个文件夹
请问怎么画这个图?是把每次的运行结果(time)存在一个列表里面嘛?
奇怪?
It’s a name of variable.The author wrote this because this variable was not going to be used.So, you can also change the name to other string that meets the rules of naming in python.
查看数据集图片的函数是少了show()么
如果在3.5.1处的实践中,在pycharm中加载不出来图片,可以尝试加一行代码在show_image(…);语句后:
pylab.show()
为什么最后要将2828的数据转化为6464呢