Windows和分号中的TensorBoard日志目录问题

问题描述 投票:0回答:1

我不知道TensorBoard本身是否存在问题,或者我在这里做错了什么...当我提供一个带有log_dir的路径时,它看起来像是在结尾处添加了分号,并且当我在使用时它正在使用正斜杠视窗。

这是我的代码:


timestamp = datetime.datetime.now().strftime('%Y-%m-%d-%H:%M:%S')
callbacks = keras.callbacks.TensorBoard(log_dir='log\\' + timestamp,
                                            histogram_freq=0, write_graph=True, write_images=False)

我试图从pathlib使用Path,但它也不起作用。

timestamp = Path(datetime.datetime.now().strftime('%Y-%m-%d--%H:%M:%S'))
log_dir = 'Graph' / timestamp

错误看起来像:

tensorflow.python.framework.errors_impl.InvalidArgumentError: Failed to create a directory: log/2019-04-25-00:15:25; Invalid argument

有任何想法吗...?

编辑:

是的,如果我打印我的时间戳,它最后没有分号。

版本:Python:3.6.7 Keras:2.2.4 Tensorflow:1.13.1

python tensorflow keras tensorboard
1个回答
0
投票

如果您使用的是Windows操作系统,那么/ \ : * ? " < > |这是不允许创建文件名的字符。由于冒号(:),您无法创建文件夹。

© www.soinside.com 2019 - 2024. All rights reserved.