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)
torchvision.datasets.ImageNet
只是一个允许您使用ImageNet数据集的类。您必须自己下载数据集(例如,从http://image-net.org/download-images)并将其路径作为root
参数传递给ImageNet类对象请注意,通过传递标志
download=True
直接下载它的选项已不再可行:(source)
如果您只需要获得类名和相应的索引,而不需要下载整个数据集(例如,如果您使用的是预训练模型,并且希望将预测映射到标签),那么您可以从here或this下载它们
相关问题 更多 >
编程相关推荐