MedicineToken / Medical-SAM-Adapter

Adapting Segment Anything Model for Medical Image Segmentation
GNU General Public License v3.0
996 stars 89 forks source link

run train.py #65

Open apuomline opened 11 months ago

apuomline commented 11 months ago

Hello author, I ran the train.py file with an error. The following is the specific content of the error:

What I entered: python train.py -net sam -mod sam_adpt -exp_name medical-sam-ada -sam_ckpt checkpoint/sam/sam_vit_b_01ec64.pth -image_size 1024 -b 8 -dataset isic --data_path ISBI2016_dataset

Namespace(net='sam', baseline='unet', seg_net='transunet', mod='sam_adpt', exp_name='medical-sam-ada', type='map', vis=None, reverse=False, pretrain=False, val_freq=100, gpu=True, gpu_device=0, sim_gpu=0, epoch_ini=1, image_size=1024, out_size=256, patch_size=2, dim=512, depth=1, heads=16, mlp_dim=1024, w=4, b=8, s=True, warm=1, lr=0.0001, uinch=1, imp_lr=0.0003, weights=0, base_weights=0, sim_weights=0, distributed='none', dataset='isic', sam_ckpt='checkpoint/sam/sam_vit_b_01ec64.pth', thd=False, chunk=96, num_sample=4, roi_size=96, evl_chunk=None, data_path='ISBI2016_dataset', path_helper={'prefix': 'logs\medical-sam-ada_2023_11_18_10_37_15', 'ckpt_path': 'logs\medical-sam-ada_2023_11_18_10_37_15\Model', 'log_path': 'logs\medical-sam-ada_2023_11_18_10_37_15\Log', 'sample_path': 'logs\medical-sam-ada_2023_11_18_10_37_15\Samples'}) n writer = SummaryWriter(log_dir=os.path.join( File "F:\miniconda\envs\medical-sam-adapter\lib\site-packages\tensorboardX\writer.py", line 300, in init self._get_file_writer() File "F:\miniconda\envs\medical-sam-adapter\lib\site-packages\tensorboardX\writer.py", line 348, in _get_file_writer self.file_writer = FileWriter(logdir=self.logdir, File "F:\miniconda\envs\medical-sam-adapter\lib\site-packages\tensorboardX\writer.py", line 104, in init self.event_writer = EventFileWriter( File "F:\miniconda\envs\medical-sam-adapter\lib\site-packages\tensorboardX\event_file_writer.py", line 104, in init directory_check(self._logdir) File "F:\miniconda\envs\medical-sam-adapter\lib\site-packages\tensorboardX\record_writer.py", line 51, in directory_check os.makedirs(path) File "F:\miniconda\envs\medical-sam-adapter\lib\os.py", line 225, in makedirs mkdir(name, mode) OSError: [WinError 123] 文件名、目录名或卷标语法不正确。: 'runs\sam\2023-11-18T10:37:14.772235'

Issues-translate-bot commented 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: run train.py error

chankeh commented 8 months ago

hi, the reason is that the system cannot support special character for directory name , you should change the code in global_settings.py, and modify the following code : `TIME_NOW = datetime.now().isoformat().replace('-', '_').replace(':', '_') `