Fail to load the imagenet2012_multilabel dataset

未关闭
#11,123 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, tensorflow

调研方向

首先复现 tfds.load('imagenet2012_multilabel'),并检查 imagenet2012_multilabel_dataset_builder.py,尤其是 _get_multi_labels_and_problematic_images 和 _MULTI_LABELS_URL。验证辅助文件 human_accuracy_v3.0.0.json 的请求,并确认数据集能够下载和准备,而不会出现 HTTP 403 错误。

由索引模型根据 Issue 内容生成。

描述

bug

Short description
tfds.load('imagenet2012_multilabel') fails during the download phase. The helper file
https://storage.googleapis.com/brain-car-datasets/imagenet-mistakes/human_accuracy_v3.0.0.json returns HTTP 403, raising tensorflow_datasets.core.download.downloader.DownloadError.

I have manually downloaded the ImageNet validation set.

Environment information
Operating System: Ubuntu 22.04
Python version: 3.9.21
tensorflow-datasets/tfds-nightly version: tensorflow-datasets 4.9.3
tensorflow/tf-nightly version: tensorflow 2.19.0

Does the issue still exist with the latest tfds-nightly package (pip install --upgrade tfds-nightly)? Yes / No (please check)

  • Does the issue still exists with the last tfds-nightly package (pip install --upgrade tfds-nightly) ?
    Yes

Reproduction instructions

import tensorflow_datasets as tfds

# Fails with HTTP 403 on a helper JSON file
ds = tfds.load('imagenet2012_multilabel')

If you share a colab, make sure to update the permissions to share it.

Link to logs

ds = tfds.load('imagenet2012_multilabel')
2025-08-25 23:01:29.655977: W external/local_xla/xla/tsl/platform/cloud/google_auth_provider.cc:184] All attempts to get a Google authentication bearer token failed, returning an empty token. Retrieving token from files failed with "NOT_FOUND: Could not locate the credentials file.". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Could not resolve hostname', error details: Could not resolve host: metadata.google.internal".
Downloading and preparing dataset 191.13 MiB (download: 191.13 MiB, generated: 2.50 GiB, total: 2.69 GiB) to /home/.../tensorflow_datasets/imagenet2012_multilabel/3.0.0...
Dl Size...: 0 MiB [00:00, ? MiB/s] | 0/1 [00:00<?, ? url/s]
Dl Completed...: 0%| | 0/1 [00:00<?, ? url/s]
Traceback (most recent call last):
File "", line 1, in
File ".../tensorflow_datasets/core/load.py", line 639, in load
_download_and_prepare_builder(dbuilder, download, download_and_prepare_kwargs)
File ".../tensorflow_datasets/core/load.py", line 498, in _download_and_prepare_builder
dbuilder.download_and_prepare(**download_and_prepare_kwargs)
File ".../tensorflow_datasets/core/dataset_builder.py", line 1547, in _download_and_prepare
split_generators = self._split_generators(
File ".../imagenet2012_multilabel_dataset_builder.py", line 115, in _split_generators
_get_multi_labels_and_problematic_images(dl_manager)
File ".../imagenet2012_multilabel_dataset_builder.py", line 48, in _get_multi_labels_and_problematic_images
with tf.io.gfile.GFile(dl_manager.download(_MULTI_LABELS_URL), 'r') as f:
File ".../download_manager.py", line 601, in download
return _map_promise(self._download, url_or_urls)
File ".../downloader.py", line 230, in _sync_download
with _open_url(url, verify=verify) as (response, iter_content):
File ".../downloader.py", line 330, in _assert_status
raise DownloadError(
tensorflow_datasets.core.download.downloader.DownloadError: Failed to get url https://storage.googleapis.com/brain-car-datasets/imagenet-mistakes/human_accuracy_v3.0.0.json. HTTP code: 403

Expected behavior
Dataset downloads and prepares without access-denied errors.

Additional context
It looks like the auxiliary JSON file used to build the multilabel annotations is no longer publicly readable.

主要语言
Python
星标
4.6k
派生
1.6k
平均合并
14 小时 3 分钟
30 天内合并 PR
5

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tensorflow/datasets 的其他 Issue

查看 tensorflow/datasets 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。