Skip to content

Commit

Permalink
Merge pull request #849 from Kaggle/fix-tensorflow-import
Browse files Browse the repository at this point in the history
Delay tensorflow_gcs_config import
  • Loading branch information
rosbo committed Jul 2, 2020
2 parents 699d273 + 222aa2f commit a901aa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion patches/kaggle_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a901aa3

Please sign in to comment.