【发布时间】:2021-02-28 17:58:29
【问题描述】:
我目前正在使用 TPU 训练我的模型。不幸的是,在使用 TensoBoard 和 TPU 时出现 X 错误。如果我只使用 TPU,那么一切正常。如果我使用 GPU 和 TensorBoard,一切正常。我使用谷歌 colab。
%tensorflow_version 2.x
import tensorflow as tf
print("Tensorflow version " + tf.__version__)
TPU_ACTIVATED = True
if TPU_ACTIVATED:
try:
tpu = tf.distribute.cluster_resolver.TPUClusterResolver() # TPU detection
print('Running on TPU ', tpu.cluster_spec().as_dict()['worker'])
except ValueError:
raise BaseException('ERROR: Not connected to a TPU runtime; please see the previous cell in this notebook for instructions!')
tf.config.experimental_connect_to_cluster(tpu)
tf.tpu.experimental.initialize_tpu_system(tpu)
tpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)
.
.
.
SAVEPATH = "/content/drive/My Drive/checker/saved"
logdir = Path(SAVEPATH, "logs", datetime.datetime.now().strftime("%Y%m%d-%H%M%S"))
.
.
.
CALLBACKS = [tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1)]
.
.
.
hist = model.fit(...,callbacks=CALLBACKS) # here is the error
错误:
UnimplementedError: File system scheme '[local]' not implemented (file: '/content/drive/My Drive/Dataset/checker/saved/logs/20201117-134736/train')
Encountered when executing an operation using EagerExecutor. This error cancels all future operations and poisons their output tensors.
为什么会出现这个错误,我该如何解决?
【问题讨论】:
标签: python tensorflow google-colaboratory tensorboard google-cloud-tpu