datasets icon indicating copy to clipboard operation
datasets copied to clipboard

`download=False` tries to retrieve token from GCE

Open SamuelMarks opened this issue 3 years ago • 0 comments

Short description I expect would like this to work well offline, without any warnings or attempts to make http(s) requests to Google (or elsewhere).

2022-05-28 16:42:11.597299: W tensorflow/core/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 "INVALID_ARGUMENT: Error executing an HTTP request: HTTP response code 400 with body '{
  "error": "invalid_grant",
  "error_description": "Bad Request"
}'". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Couldn't resolve host name', error details: Could not resolve host: metadata"

Environment information

  • Operating System: macOS 12.4 (21F79)

  • Python version: 3.9.13

  • tensorflow-datasets/tfds-nightly version: 4.5.2

  • tensorflow/tf-nightly version: 2.9.1

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

Reproduction instructions On a fresh virtualenv on a computer that has never used TensorFlow or TensorFlow datasets:

import new_dataset_based_on_voc_py
# Based ^ on https://github.com/tensorflow/datasets/blob/fdad1d9/tensorflow_datasets/object_detection/voc.py
import tensorflow_datasets as tfds

print("Loading:", new_dataset_based_on_voc_py._NewDataSetBasedOnVoc_CITATION)
tfds.load("new_dataset_based_on_voc_py",
          data_dir=new_dataset_based_on_voc_py_data_dir,
          download=False)

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

Link to logs

2022-05-28 16:42:07 - tensorflow - DEBUG - Falling back to TensorFlow client; we recommended you install the Cloud TPU client directly with pip install cloud-tpu-client.
2022-05-28 16:42:07 - h5py._conv - DEBUG - Creating converter from 7 to 5
2022-05-28 16:42:07 - h5py._conv - DEBUG - Creating converter from 5 to 7
2022-05-28 16:42:07 - h5py._conv - DEBUG - Creating converter from 7 to 5
2022-05-28 16:42:07 - h5py._conv - DEBUG - Creating converter from 5 to 7
Loading: Geophysics dataset
2022-05-28 16:42:10 - absl - INFO - No config specified, defaulting to first: geo_phys/2022
2022-05-28 16:42:11 - absl - INFO - Constructing tf.data.Dataset new_dataset_based_on_voc_py for split None, from /tmp/<dir>/1.0.0
2022-05-28 16:42:11.597299: W tensorflow/core/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 "INVALID_ARGUMENT: Error executing an HTTP request: HTTP response code 400 with body '{
  "error": "invalid_grant",
  "error_description": "Bad Request"
}'". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Couldn't resolve host name', error details: Could not resolve host: metadata".

Expected behavior No attempt at HTTP(S) requests if download=False. Maybe there's another config option I need to enable for this? - Otherwise it's a bug.

Additional context N/A

EDIT: I found the try_download_gcs=True parameter to tfds.download.DownloadConfig… but when download=False shouldn't this also be False?

SamuelMarks avatar May 28 '22 20:05 SamuelMarks