eric-yyjau/pytorch-superpoint

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect

VickkyMama opened this issue · 2 comments

Hi, I followed the steps on github for implementation but it displayed this - OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'runs/train_base/magicpoint_synth_2023-03-14_13:08:15'

I am running on Conda PyCharm

It works well on Google Colab but I want to run it on my local computer. I have searched online but couldn't get any help.

This is the complete error message. Please help urgently

(py36-sp) C:\Users\pytorchSuperpoint>python train4.py train_base configs/magicpoint_shapes_pair.yaml magicpoint_synth --eval
2023-03-14 12:53:54 LAPTOP root[5452] INFO Running command TRAIN_BASE
2023-03-14 12:53:54 LAPTOP root[5452] INFO train on device: cpu
Traceback (most recent call last):
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\site-packages\tensorboardX\record_writer.py", line 47, in directory_check
factory = REGISTERED_FACTORIES[prefix]
KeyError: 'runs/train_base/magicpoint_synth_2023-03-14_12'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train4.py", line 141, in
args.func(config, output_dir, args)
File "train4.py", line 41, in train_base
return train_joint(config, output_dir, args)
File "train4.py", line 62, in train_joint
exper_name=args.exper_name, date=True))
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\site-packages\tensorboardX\writer.py", line 293, in init
self._get_file_writer()
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\site-packages\tensorboardX\writer.py", line 345, in _get_file_writer
**self.kwargs)
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\site-packages\tensorboardX\writer.py", line 104, in init
logdir, max_queue, flush_secs, filename_suffix)
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\site-packages\tensorboardX\event_file_writer.py", line 104, in init
directory_check(self._logdir)
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\site-packages\tensorboardX\record_writer.py", line 51, in directory_check
os.makedirs(path)
File "C:\Users\anaconda3\envs\Superpoint\envs\py36-sp\lib\os.py", line 220, in makedirs
mkdir(name, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'runs/train_base/magicpoint_synth_2023-03-14_13:08:15'

Solved.

Windows does not support some special characters as filename and the filename had time (:) so I had to change to underscore (_).
It can be changed in the utils.py line 901

from this:

str_date_time = datetime.datetime.now().strftime("%Y-%m-%d_%H:%M:%S")

To this:

str_date_time = datetime.datetime.now().strftime("%Y-%m-%d_%H_%M_%S")

I encountered the same problem as you, thank you for your answer. It has helped me a lot.