google-research / text-to-text-transfer-transformer

Code for the paper "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer"
https://arxiv.org/abs/1910.10683
Apache License 2.0
6.15k stars 756 forks source link

Cannot run setup section of the t5-trivia codelab due to error importing tensorflow_gcs_config #1027

Open adelinac opened 2 years ago

adelinac commented 2 years ago

When trying to run the setup section of the t5-trivia codelab I get the following error:

Setting up GCS access...

NotImplementedError Traceback (most recent call last) in () 32 # Use legacy GCS authentication method. 33 os.environ['USE_AUTH_EPHEM'] = '0' ---> 34 import tensorflow_gcs_config 35 from google.colab import auth 36 # Set credentials for GCS reading/writing from Colab and TPU.

1 frames /usr/local/lib/python3.7/dist-packages/tensorflow_gcs_config/init.py in _load_library(filename, lib) 55 raise NotImplementedError( 56 "unable to open file: " + ---> 57 "{}, from paths: {}\ncaused by: {}".format(filename, filenames, errs)) 58 59 _gcs_config_so = _load_library("_gcs_config_ops.so")

NotImplementedError: unable to open file: _gcs_config_ops.so, from paths: ['/usr/local/lib/python3.7/dist-packages/tensorflow_gcs_config/_gcs_config_ops.so'] caused by: ['/usr/local/lib/python3.7/dist-packages/tensorflow_gcs_config/_gcs_config_ops.so: undefined symbol: _ZNK10tensorflow8OpKernel11TraceStringERKNS_15OpKernelContextEb']

This seems to have happened before: https://github.com/google-research/text-to-text-transfer-transformer/issues/319, however I was not able to use any of the recommended workarounds.

rjiles commented 2 years ago

same issue

jspablo commented 2 years ago

Updating that package version with !pip install -U tensorflow-gcs-config==2.9.1 fix notebook access to GCS

rjiles commented 2 years ago

Thank you! Confirmed this fixes my issue

coreyfournier commented 1 year ago

I just started getting this issue. Changing versions has no effect.

colefranks commented 1 year ago

same

coreyfournier commented 1 year ago

I found a workaround by adding TPU service account to the bucket.

  1. Remove any references to tensorflow_gcs_config.
  2. Remove "os.environ['USE_AUTH_EPHEM'] = '0'"
  3. Let the code fail.
  4. You will get a permissions error from the TPU that contains the name of the service account requiring access. I assume the service account is different for everyone. EX: service-xxxxxxxxxxx@cloud-tpu.iam.gserviceaccount.com does not have storage.objects.list access to the Google Cloud Storage bucket. Permission 'storage.objects.list' denied on resource (or it may not exist)."
  5. Log into GCS console. Navigate to the bucket.
  6. Click on Permissions.
  7. Assign the role "Storage Object Admin" to the service account listed above.

Now run your project.