Medical-SAM-Adapter icon indicating copy to clipboard operation
Medical-SAM-Adapter copied to clipboard

IndexError: single positional indexer is out-of-bounds

Open pascal-maker opened this issue 1 year ago • 0 comments

Hello when i run the command : !python /content/Medical-SAM-Adapter/train.py -net sam -mod sam_adpt -exp_name pascal_run -sam_ckpt ./checkpoint/sam/sam_vit_b_01ec64.pth -image_size 1024 -b 32 -dataset isic -data_path /content/drive/MyDrive/ISIC/data/isic I receive the following error : Contents of the destination directory: ['ISBI2016_ISIC_Part1_Test_GroundTruth.csv', 'ISBI2016_ISIC_Part1_Training_GroundTruth.csv'] Namespace(net='sam', baseline='unet', encoder='default', seg_net='transunet', mod='sam_adpt', exp_name='pascal_run', type='map', vis=None, reverse=False, pretrain=False, val_freq=5, 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=32, 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=None, num_sample=4, roi_size=96, evl_chunk=None, mid_dim=None, multimask_output=1, data_path='/content/drive/MyDrive/ISIC/data/isic', path_helper={'prefix': 'logs/pascal_run_2024_05_30_10_06_55', 'ckpt_path': 'logs/pascal_run_2024_05_30_10_06_55/Model', 'log_path': 'logs/pascal_run_2024_05_30_10_06_55/Log', 'sample_path': 'logs/pascal_run_2024_05_30_10_06_55/Samples'}) Traceback (most recent call last): File "/content/Medical-SAM-Adapter/train.py", line 147, in main() File "/content/Medical-SAM-Adapter/train.py", line 74, in main nice_train_loader, nice_test_loader = get_dataloader(args) ^^^^^^^^^^^^^^^^^^^^ File "/content/Medical-SAM-Adapter/dataset/init.py", line 46, in get_dataloader isic_train_dataset = ISIC2016(args, args.data_path, transform = transform_train, transform_msk= transform_train_seg, mode = 'Training') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/content/Medical-SAM-Adapter/dataset/isic.py", line 16, in init self.name_list = df.iloc[:,1].tolist() ~~~~~~~^^^^^ File "/usr/local/lib/python3.12/site-packages/pandas/core/indexing.py", line 1184, in getitem return self._getitem_tuple(key) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pandas/core/indexing.py", line 1690, in _getitem_tuple tup = self._validate_tuple_indexer(tup) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pandas/core/indexing.py", line 966, in _validate_tuple_indexer self._validate_key(k, i) File "/usr/local/lib/python3.12/site-packages/pandas/core/indexing.py", line 1592, in _validate_key self._validate_integer(key, axis) File "/usr/local/lib/python3.12/site-packages/pandas/core/indexing.py", line 1685, in _validate_integer raise IndexError("single positional indexer is out-of-bounds") IndexError: single positional indexer is out-of-bounds. I havre set up my datastructure as our dataset folder under "your_data_path" should be like: ISIC/ ISBI2016_ISIC_Part1_Test_Data/...

ISBI2016_ISIC_Part1_Training_Data/...

ISBI2016_ISIC_Part1_Test_GroundTruth.csv

ISBI2016_ISIC_Part1_Training_GroundTruth.csv

pascal-maker avatar May 30 '24 11:05 pascal-maker