From 222aa2fca6c535cc07a0e50dea939f9dcc2df6a7 Mon Sep 17 00:00:00 2001 From: Vincent Roseberry Date: Wed, 1 Jul 2020 00:13:43 +0000 Subject: [PATCH] Delay tensorflow_gcs_config import --- patches/kaggle_secrets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/kaggle_secrets.py b/patches/kaggle_secrets.py index bd99330e..1ee81f78 100644 --- a/patches/kaggle_secrets.py +++ b/patches/kaggle_secrets.py @@ -7,7 +7,6 @@ import json import os import socket -import tensorflow_gcs_config import urllib.request from datetime import datetime, timedelta from enum import Enum, unique @@ -140,6 +139,9 @@ def set_tensorflow_credential(self, credential): """Sets the credential for use by Tensorflow both in the local notebook and to pass to the TPU. """ + # b/159906185: Import tensorflow_gcs_config only when this method is called to prevent preloading TensorFlow. + import tensorflow_gcs_config + # Write to a local JSON credentials file and set # GOOGLE_APPLICATION_CREDENTIALS for tensorflow running in the notebook. adc_path = os.path.join(