ProfilerNotRunningError: Cannot stop profiling. No profiler is running.
前言:
代码检查一万遍,都没错,就是来一个ProfilerNotRunningError: Cannot stop profiling. No profiler is running.
查了一些资料,发现这个问题只有在windows下出现,linux下不会出现,是文件路径写法导致的:
logdir = ‘./logs/’ >> 会报错
要使用os.path.join写法才可以解决
# logdir = "./callbacks" 这个写法会报错,要使用下面的os.path写法
logdir = os.path.join("callbakcs") # 记录回调tensorboard日志打印记录
if not os.path.exists(logdir):
os.mkdir(logdir)
output_model_file = os.path.join(logdir,"test_classification.h5") # 保存训练最好的模型