abrilcf / mednerf

MIT License
139 stars 30 forks source link

IndexError #17

Closed georgeasrian closed 8 months ago

georgeasrian commented 10 months ago

In trying to run "python train.py configs/knee.yaml" I am seeing this error:

Traceback (most recent call last): File "...\mednerf\graf-main\train.py", line 140, in x_real = get_nsamples(train_loader, ntest) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\mednerf\graf-main\graf\utils.py", line 67, in get_nsamples x_next = next(data_loader) ^^^^^^^^^^^^^^^^^ File "...\mednerf\Lib\site-packages\torch\utils\data\dataloader.py", line 630, in next data = self._next_data() ^^^^^^^^^^^^^^^^^ File "...\mednerf\Lib\site-packages\torch\utils\data\dataloader.py", line 673, in _next_data index = self._next_index() # may raise StopIteration ^^^^^^^^^^^^^^^^^^ File "...\mednerf\Lib\site-packages\torch\utils\data\dataloader.py", line 620, in _next_index return next(self._sampler_iter) # may raise StopIteration ^^^^^^^^^^^^^^^^^^^^^^^^ File "...\mednerf\Lib\site-packages\torch\utils\data\sampler.py", line 283, in iter for idx in self.sampler: File "\mednerf\graf-main\graf\utils.py", line 45, in InfiniteSampler yield order[i]

IndexError: index -1 is out of bounds for axis 0 with size 0

abrilcf commented 10 months ago

Hi could you please check if the path to the folder of your data is correct? I added an exception in the dataset to verify.

Abeltemi commented 8 months ago

Hi could you please check if the path to the folder of your data is correct? I added an exception in the dataset to verify.

How do i locate the path that call the datasets because i am getting the same error, and i think it has to do with where the datasets is located.

Abeltemi commented 8 months ago

Or where exactly am i suppose to place the extracted mednerf_drr_dataset directory. as it contains both the chest_xrays and knee_xrays

abrilcf commented 8 months ago

Apologies for the delay, You specify the path in the config file using the datadir argument.

baibai-c commented 4 months ago

I also encountered this problem when I was running the code. May I ask you if you finally solved this problem? Thank you very much @georgeasrian