Skip to content

Commit f908f78

Browse files
author
Antigravity Agent
committed
Update train.py
1 parent 4e43e3e commit f908f78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

snn-dt/scripts/train.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
import logging
33
import os
44
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+
517
import time
618
import tempfile
719
import atexit

0 commit comments

Comments
 (0)