Skip to content

Commit c62c4f5

Browse files
authored
Replace colon with dash in timestamp variables (#620)
Prevent OS errors when running the Semantic Segmentation program on exFAT SSD.
1 parent fb87da2 commit c62c4f5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

ml3d/tf/pipelines/object_detection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run_test(self):
6262
dataset = self.dataset
6363
cfg = self.cfg
6464

65-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
65+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
6666

6767
log_file_path = join(cfg.logs_dir, 'log_test_' + timestamp + '.txt')
6868
log.info("Logging in file : {}".format(log_file_path))
@@ -111,7 +111,7 @@ def run_valid(self, epoch=0):
111111
dataset = self.dataset
112112
cfg = self.cfg
113113

114-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
114+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
115115

116116
log_file_path = join(cfg.logs_dir, 'log_valid_' + timestamp + '.txt')
117117
log.info("Logging in file : {}".format(log_file_path))
@@ -212,7 +212,7 @@ def run_train(self):
212212

213213
cfg = self.cfg
214214

215-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
215+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
216216
log_file_path = join(cfg.logs_dir, 'log_train_' + timestamp + '.txt')
217217
log.info("Logging in file : {}".format(log_file_path))
218218
log.addHandler(logging.FileHandler(log_file_path))

ml3d/tf/pipelines/semantic_segmentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def run_test(self):
147147
cfg = self.cfg
148148

149149
self.load_ckpt(model.cfg.ckpt_path)
150-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
150+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
151151

152152
log_file_path = join(cfg.logs_dir, 'log_test_' + timestamp + '.txt')
153153
log.info("Logging in file : {}".format(log_file_path))
@@ -192,7 +192,7 @@ def run_train(self):
192192
cfg = self.cfg
193193

194194
log.info(model)
195-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
195+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
196196
log_file_path = join(cfg.logs_dir, 'log_train_' + timestamp + '.txt')
197197
log.info("Logging in file : {}".format(log_file_path))
198198
log.addHandler(logging.FileHandler(log_file_path))

ml3d/torch/pipelines/object_detection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def run_test(self):
8585

8686
model.eval()
8787

88-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
88+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
8989

9090
log.info("DEVICE : {}".format(device))
9191
log_file_path = join(cfg.logs_dir, 'log_test_' + timestamp + '.txt')
@@ -145,7 +145,7 @@ def run_valid(self, epoch=0):
145145

146146
model.eval()
147147

148-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
148+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
149149

150150
log.info("DEVICE : {}".format(device))
151151
log_file_path = join(cfg.logs_dir, 'log_valid_' + timestamp + '.txt')
@@ -282,7 +282,7 @@ def run_train(self):
282282

283283
if rank == 0:
284284
log.info("DEVICE : {}".format(device))
285-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
285+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
286286

287287
log_file_path = join(cfg.logs_dir,
288288
'log_train_' + timestamp + '.txt')

ml3d/torch/pipelines/semantic_segmentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def run_test(self):
190190
model.eval()
191191
self.metric_test = SemSegMetric()
192192

193-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
193+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
194194

195195
log.info("DEVICE : {}".format(device))
196196
log_file_path = join(cfg.logs_dir, 'log_test_' + timestamp + '.txt')
@@ -320,7 +320,7 @@ def run_train(self):
320320
model.to(device)
321321

322322
log.info("DEVICE : {}".format(device))
323-
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
323+
timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
324324

325325
log_file_path = join(cfg.logs_dir, 'log_train_' + timestamp + '.txt')
326326
log.info("Logging in file : {}".format(log_file_path))

0 commit comments

Comments
 (0)