MedicineToken / Medical-SAM-Adapter

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

NameError: name 'nice_train_loader' is not defined #61

Closed WesleyWu42 closed 7 months ago

WesleyWu42 commented 11 months ago

when i try to train 3d dataset as example,it reported NameError: name 'nice_train_loader' is not defined,how to fix this

danielsmileplz commented 8 months ago

same trouble here. anyone knows how to fix it?

danielsmileplz commented 8 months ago

i see. the problem is in 'dataset.py'. you need to write another dataset class.

ignacio-scarinci commented 7 months ago

Hi, the problem is in the readme, specifically in

python train.py -net sam -mod sam_adpt -exp_name msa-3d-sam-btcv -sam_ckpt ./checkpoint/sam/sam_vit_b_01ec64.pth -image_size 1024 -b 8 -dataset decathlon -thd True -chunk 96 -dataset ../data -num_sample 4

If you see that the dataset args is doubled, then train.py understands that the dataset is ../data. You need to change the second dataset to data_path. This simple change will solve the problem.

WuJunde commented 7 months ago

Hi, the problem is in the readme, specifically in

python train.py -net sam -mod sam_adpt -exp_name msa-3d-sam-btcv -sam_ckpt ./checkpoint/sam/sam_vit_b_01ec64.pth -image_size 1024 -b 8 -dataset decathlon -thd True -chunk 96 -dataset ../data -num_sample 4

If you see that the dataset args is doubled, then train.py understands that the dataset is ../data. You need to change the second dataset to data_path. This simple change will solve the problem.

Thank you for your solution, I have fixed ReadMe