我不知道TensorBoard本身是否有问题或者我在这里做错了什么... 当我提供带有log_dir的路径时,似乎在末尾添加了分号,并且在Windows上使用正斜杠。
这是我的代码:
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
答案 0 :(得分:0)
如果您使用的是Windows操作系统,/ \ : * ? " < > |
是不允许创建文件名的字符。由于冒号(:
),您无法创建文件夹。