Catch AttributeError
@@ -90,7 +90,13 @@ def is_tpu_available():
try:
from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver # type: ignore # noqa
from tensorflow.python.profiler import profiler_client # type: ignore # noqa
- except (ImportError, TypeError): # Saw type error when iterating paths on colab...
+ except (
+ ImportError,
+ TypeError,
+ AttributeError,
+ ): # Saw type error when iterating paths on colab...
+ # TODO: Saw sentry error (https://sentry.io/organizations/weights-biases/issues/2699838212/?project=5288891&query=firstRelease%3A0.12.4&statsPeriod=14d) where
+ # module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_DEVICE_PLACEMENT_EXPLICIT'
return False
return "TPU_NAME" in os.environ
