Pytorch ImageNet 数据集

reg*_*ald 5 python dataset imagenet pytorch

我无法从他们的官方网站下载原始 ImageNet 数据集。但是,我发现 pytorch 将 ImageNet 作为其火炬视觉数据集之一。

一季度。那是原始的 ImageNet 数据集吗?

Q2。我如何像在 Cifar-10 中那样获取数据集的类

classes = [‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’]
Run Code Online (Sandbox Code Playgroud)

And*_*dyK 8

torchvision.datasets.ImageNet只是一个允许您使用 ImageNet 数据集的类。您必须自己下载数据集(例如从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)
Run Code Online (Sandbox Code Playgroud)

来源

如果您只需要在不下载整个数据集的情况下获取类名和相应的索引(例如,如果您使用的是预训练模型并希望将预测映射到标签),那么您可以从这里或从这个github gist下载它们.

  • 链接 http://image-net.org/download-images 似乎不起作用:它提供从 http://www.image-net.org/archive/stanford/fall11_whole.tar 下载完整数据集,这会产生 404 错误。 (3认同)