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") # 保存訓練最好的模型