Open wd923923 opened 5 years ago
目录名称无效。: 'logs\0821-01:30' 把"-"改成"_"试试
请问您的问题解决了吗 我也遇到了一样的问题,是因为windows的原因吗?
utils/logger.py 26行改一下就可以了 比如 "timestamp = datetime.fromtimestamp(time.time()).strftime('%m%d%H%M')"
utils/logger.py 26行改一下就可以了 比如 "timestamp = datetime.fromtimestamp(time.time()).strftime('%m%d%H%M')"
已经弄好了 谢谢
(pytorch-yolov3) C:\YOLOv3-model-pruning-master>python train.py --model_def config/yolov3-hand.cfg Namespace(batch_size=16, checkpoint_interval=5, data_config='config/oxfordhand.data', debug_file='debug', epochs=100, evaluation_interval=1, img_size=416, lr=0.001, model_def='config/yolov3-hand.cfg', multiscale_training=False, n_cpu=4, pretrained_weights='weights/yolov3.weights', s=0.01, sr=False) Traceback (most recent call last): File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\site-packages\tensorboardX\record_writer.py", line 40, in directory_check factory = REGISTERED_FACTORIES[prefix] KeyError: 'logs\0821-01'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "train.py", line 50, in
logger = Logger("logs")
File "C:\YOLOv3-model-pruning-master\utils\logger.py", line 27, in init
self.writer = SummaryWriter(os.path.join(log_dir, timestamp))
File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\site-packages\tensorboardX\writer.py", line 257, in init
self._get_file_writer()
File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\site-packages\tensorboardX\writer.py", line 321, in _get_file_writer
**self.kwargs)
File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\site-packages\tensorboardX\writer.py", line 93, in init
logdir, max_queue, flush_secs, filename_suffix)
File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\site-packages\tensorboardX\event_file_writer.py", line 104, in init
directory_check(self._logdir)
File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\site-packages\tensorboardX\record_writer.py", line 44, in directory_check
os.makedirs(path)
File "C:\Users\923\Anaconda3\envs\pytorch-yolov3\lib\os.py", line 220, in makedirs
mkdir(name, mode)
NotADirectoryError: [WinError 267] 目录名称无效。: 'logs\0821-01:30'