Pytorch ImageNet 数据集
Pytorch ImageNet dataset
我无法从他们的官方网站下载原始 ImageNet 数据集。但是,我发现 pytorch 将 ImageNet 作为其 torch 视觉数据集之一。
Q1。那是原始的 ImageNet 数据集吗?
Q2。如何像在 Cifar-10
中那样获取数据集的 类
classes = [‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’]
torchvision.datasets.ImageNet
只是一个 class,它允许您使用 ImageNet 数据集。您必须自己下载数据集(例如从 http://image-net.org/download-images)并将其路径作为 root
参数传递给 ImageNet class 对象。
请注意,通过传递标志 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)
如果您只需要获取 class 个名称和相应的索引而不需要下载整个数据集(例如,如果您使用的是预训练模型并希望将预测映射到标签),那么您可以下载他们例如来自 here or from this github 要点。
我无法从他们的官方网站下载原始 ImageNet 数据集。但是,我发现 pytorch 将 ImageNet 作为其 torch 视觉数据集之一。
Q1。那是原始的 ImageNet 数据集吗?
Q2。如何像在 Cifar-10
中那样获取数据集的 类classes = [‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’]
torchvision.datasets.ImageNet
只是一个 class,它允许您使用 ImageNet 数据集。您必须自己下载数据集(例如从 http://image-net.org/download-images)并将其路径作为 root
参数传递给 ImageNet class 对象。
请注意,通过传递标志 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)
如果您只需要获取 class 个名称和相应的索引而不需要下载整个数据集(例如,如果您使用的是预训练模型并希望将预测映射到标签),那么您可以下载他们例如来自 here or from this github 要点。