我无法从他们的官方网站下载原始的ImageNet数据集。然而,我发现pytorch将ImageNet作为其torch视觉数据集之一。
Q1。这是原始的ImageNet数据集吗?
Q2。如何像在Cifar-10中那样获取数据集的类
classes = [‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’]发布于 2020-03-10 14:52:51
torchvision.datasets.ImageNet只是一个允许您使用ImageNet数据集的类。您必须自己下载dataset (例如,从http://image-net.org/download-images下载),并将其路径作为root参数传递给ImageNet类对象。
请注意,通过传递标志download=True直接下载它的选项不再可行:
if download is True:
msg = ("The dataset is no longer publicly accessible. You need to "
"download the archives externally and place them in the root "
"directory.")
raise RuntimeError(msg)
elif download is False:
msg = ("The use of the download flag is deprecated, since the dataset "
"is no longer publicly accessible.")
warnings.warn(msg, RuntimeWarning)(source)
如果您只需要获取类名和相应的索引,而不需要下载整个数据集(例如,如果您使用的是预训练模型并希望将预测映射到标签),那么您可以从here或this github gist下载它们。
https://stackoverflow.com/questions/60607824
复制相似问题