We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e43e3e commit f908f78Copy full SHA for f908f78
snn-dt/scripts/train.py
@@ -2,6 +2,18 @@
2
import logging
3
import os
4
import sys
5
+
6
+# Workaround for broken TensorFlow installations on Windows (e.g. missing tf.io)
7
+# preventing torch.utils.tensorboard (and thus norse) from loading.
8
+try:
9
+ import tensorflow as tf
10
+ if not hasattr(tf, "io"):
11
+ # If tensorflow is broken, hide it so downstream imports (like tensorboard)
12
+ # fallback to not using it, rather than crashing on attribute access.
13
+ sys.modules["tensorflow"] = None
14
+except ImportError:
15
+ pass
16
17
import time
18
import tempfile
19
import atexit
0 commit comments