Browse Source

fix bug in plog.py

pull/3/head
Gao Enhao 3 years ago
parent
commit
6806a3cfbf
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      utils/plog.py

+ 2
- 3
utils/plog.py View File

@@ -36,15 +36,14 @@ class ResultRecorder:
local_time = time.strftime("%Y%m%d_%H_%M_%S", time.localtime())

save_dir = os.path.join("results", local_time)
if not os.path.exists(save_dir):
os.makedirs(save_dir)
save_file_path = os.path.join(save_dir, "result.pk")
save_file = open(save_file_path, "wb")
self.save_dir = save_dir
self.save_file = save_file

if not os.path.exists(save_dir):
os.makedirs(save_dir)

filename = os.path.join(save_dir, "log.txt")
file_handler = logging.FileHandler(filename)
file_handler.setLevel(logging.DEBUG)


Loading…
Cancel
Save