MedSegDiff icon indicating copy to clipboard operation
MedSegDiff copied to clipboard

Sample Running Error

Open Kuzu710 opened this issue 1 year ago • 1 comments

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,出现上述错误,求解

Kuzu710 avatar May 24 '23 09:05 Kuzu710

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

jojo803 avatar May 25 '23 09:05 jojo803