KidsWithTokens / MedSegDiff

Medical Image Segmentation with Diffusion Model
MIT License
979 stars 147 forks source link

Sample Running Error #112

Open Kuzu710 opened 1 year ago

Kuzu710 commented 1 year ago

Logging to ./results/ creating model and diffusion... Traceback (most recent call last): File "segmentation_sample.py", line 192, in main() File "segmentation_sample.py", line 94, in main b, path = next(data) #should return an image from the dataloader "data" File "/opt/conda/envs/jyp37/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 628, in next data = self._next_data() File "/opt/conda/envs/jyp37/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 671, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/opt/conda/envs/jyp37/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/conda/envs/jyp37/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in data = [self.dataset[idx] for idx in possibly_batched_index] File "../guided_diffusion/bratsloader.py", line 124, in getitem o = torch.tensor(nib_img.get_fdata())[:,:,slice] IndexError: too many indices for tensor of dimension 2 使用Brat2020数据集进行sample,出现上述错误,求解

jojo803 commented 1 year ago

I have the same question, have you figured it out?