Closed CharlieLi2S closed 5 months ago
The error message you encountered suggests that TensorFlow is trying to authenticate with Google Cloud services to retrieve authentication tokens, but it's unable to do so because it's running in an environment where it can't access the necessary credentials.
Since you're working with a local dataset and don't need to interact with Google Cloud storage, you can disable the Google authentication by setting the environment variable GOOGLE_APPLICATION_CREDENTIALS
to an empty string before running your script.
Here's how you can modify your script to disable Google authentication:
import os
# Disable Google Cloud authentication
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = ''
# Now import the required modules
import glob
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
import tensorflow_hub as hub
# Your existing code follows...
Adding this code at the beginning of your script will prevent TensorFlow from attempting to authenticate with Google Cloud services, and it should resolve the error you encountered.
Additionally, make sure that the file paths you're providing in your script ('/home/universal_sentence_encoder'
) are correct and accessible within your Docker container environment.
Once you've made these modifications, try running your script again:
python language_table_use_dataset_builder.py
This should allow your script to build the dataset without encountering authentication errors. If you encounter any further issues, please let me know, and I'll be happy to assist you further.
The error message you encountered suggests that TensorFlow is trying to authenticate with Google Cloud services to retrieve authentication tokens, but it's unable to do so because it's running in an environment where it can't access the necessary credentials.
Since you're working with a local dataset and don't need to interact with Google Cloud storage, you can disable the Google authentication by setting the environment variable
GOOGLE_APPLICATION_CREDENTIALS
to an empty string before running your script.Here's how you can modify your script to disable Google authentication:
import os # Disable Google Cloud authentication os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '' # Now import the required modules import glob import numpy as np import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_hub as hub # Your existing code follows...
Adding this code at the beginning of your script will prevent TensorFlow from attempting to authenticate with Google Cloud services, and it should resolve the error you encountered.
Additionally, make sure that the file paths you're providing in your script (
'/home/universal_sentence_encoder'
) are correct and accessible within your Docker container environment.Once you've made these modifications, try running your script again:
python language_table_use_dataset_builder.py
This should allow your script to build the dataset without encountering authentication errors. If you encounter any further issues, please let me know, and I'll be happy to assist you further.
Thanks for your suggestion, but it seems that the issue is still remaining
Hi,
Can you confirm that this message is related to your dataset preparation not working? Seems like it could be just a warning that shouldn't prevent the script from executing (see https://github.com/tensorflow/datasets/issues/2761)
You can also try using:
tfds.core.utils.gcs_utils._is_gcs_disabled = True
os.environ['NO_GCE_CHECK'] = 'true'
To avoid the error message
Let us know if it works.
Hi,
Can you confirm that this message is related to your dataset preparation not working? Seems like it could be just a warning that shouldn't prevent the script from executing (see #2761)
You can also try using:
tfds.core.utils.gcs_utils._is_gcs_disabled = True os.environ['NO_GCE_CHECK'] = 'true'
To avoid the error message
Let us know if it works.
it works, thanks
What I need help with / What I was wondering I intended to build a dataset modifying language_table_sim by embedding the natural language instructions of the original dataset. Here's what I've done: I downloaded language_table_sim and loaded and saved the data as numpy files:
then I write the builder script and placed it under the same dir with data I tried to build the dataset by commanding
while the error occurs:
it seems that the builder is connecting to google storage, but I belive I don't need that, because all the data are local I've searched related issues such as https://github.com/tensorflow/datasets/issues/5194#issue-2043792034 but I can't fix it so I really appreciate that if you can help me
here's my builder script: """language_table_use_dataset_builder.py"""
from typing import Iterator, Tuple, Any
import glob import numpy as np import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_hub as hub
class LanguageTableUse(tfds.core.GeneratorBasedBuilder): """DatasetBuilder for example dataset."""
Environment information I was running it inside a docker container, the image is tensorflow 2.14-gpu, and I've install several packages myself
tensorflow-datasets
/tfds-nightly
version: tensorflow-datasets 4.9.4tensorflow
/tensorflow-gpu
/tf-nightly
/tf-nightly-gpu
version: tensorflow 2.14.0