Skip to content

Commit a901aa3

Browse files
authored
Merge pull request #849 from Kaggle/fix-tensorflow-import
Delay tensorflow_gcs_config import
2 parents 699d273 + 222aa2f commit a901aa3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

patches/kaggle_secrets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import json
88
import os
99
import socket
10-
import tensorflow_gcs_config
1110
import urllib.request
1211
from datetime import datetime, timedelta
1312
from enum import Enum, unique
@@ -140,6 +139,9 @@ def set_tensorflow_credential(self, credential):
140139
"""Sets the credential for use by Tensorflow both in the local notebook
141140
and to pass to the TPU.
142141
"""
142+
# b/159906185: Import tensorflow_gcs_config only when this method is called to prevent preloading TensorFlow.
143+
import tensorflow_gcs_config
144+
143145
# Write to a local JSON credentials file and set
144146
# GOOGLE_APPLICATION_CREDENTIALS for tensorflow running in the notebook.
145147
adc_path = os.path.join(

0 commit comments

Comments
 (0)