Traceback (most recent call last):
? File "C:/Users/liqiang/Desktop/LapDepth/train.py", line 217, in <module>
? ? main_worker(args.gpu, ngpus_per_node, args)
? File "C:/Users/liqiang/Desktop/LapDepth/train.py", line 80, in main_worker
? ? args.save_path.makedirs_p()
? File "D:\programfiles\miniconda\envs\py38torch_gpu\lib\site-packages\path\__init__.py", line 1124, in makedirs_p
? ? self.makedirs(mode)
? File "D:\programfiles\miniconda\envs\py38torch_gpu\lib\site-packages\path\__init__.py", line 1117, in makedirs
? ? os.makedirs(self, mode)
? File "D:\programfiles\miniconda\envs\py38torch_gpu\lib\os.py", line 223, in makedirs
? ? mkdir(name, mode)
NotADirectoryError: [WinError 267] 目录名称无效。: Path('checkpoints\\KITTI,b8\\05-23-16:24')
Process finished with exit code 1
def save_path_formatter(args, parser):
def is_default(key, value):
return value == parser.get_default(key)
args_dict = vars(args)
data_folder_name = str(Path(args_dict['data_path']).normpath().name)
folder_string = [data_folder_name]
if not is_default('epochs', args_dict['epochs']):
folder_string.append('{}epochs'.format(args_dict['epochs']))
keys_with_prefix = OrderedDict()
keys_with_prefix['epoch_size'] = 'epoch_size'
keys_with_prefix['batch_size'] = 'b'
keys_with_prefix['lr'] = 'lr'
for key, prefix in keys_with_prefix.items():
value = args_dict[key]
if not is_default(key, value):
folder_string.append('{}{}'.format(prefix, value))
save_path = Path(','.join(folder_string))
timestamp = datetime.datetime.now().strftime("%m-%d-%H:%M")
return save_path / timestamp