LeiaLi / SRDiff

171 stars 19 forks source link

IndexError During Model Evaluation in SRDiff with Transfer Learning #23

Closed TakuroShimoyama closed 1 month ago

TakuroShimoyama commented 1 month ago

Hi,

I am encountering an issue while performing transfer learning with SRDiff and trying to evaluate the model. Specifically, I am seeing the following error during the evaluation phase:

Traceback (most recent call last): File "/home/oniwaka/lab/shimoyama/SRDiff/trainer.py", line 251, in <module> trainer.test() File "/home/oniwaka/lab/shimoyama/SRDiff/trainer.py", line 148, in test for batch_idx, batch in pbar: File "/home/oniwaka/miniconda3/envs/myenv/lib/python3.12/site-packages/tqdm/std.py", line 1181, in __iter__ for obj in iterable: File "/home/oniwaka/miniconda3/envs/myenv/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 630, in __next__ data = self._next_data() File "/home/oniwaka/miniconda3/envs/myenv/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 673, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/oniwaka/miniconda3/envs/myenv/lib/python3.12/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/oniwaka/lab/shimoyama/SRDiff/dataset.py", line 32, in __getitem__ item = self._get_item(index) File "/home/oniwaka/lab/shimoyama/SRDiff/srdiff_celeb.py", line 36, in _get_item return self.indexed_ds[index] File "/home/oniwaka/lab/shimoyama/SRDiff/indexed_datasets.py", line 28, in __getitem__ self.check_index(i) File "/home/oniwaka/lab/shimoyama/SRDiff/indexed_datasets.py", line 19, in check_index raise IndexError('index out of range')

I noticed that the test_ids in the celeb_a.yaml file might not have been updated, which seems to be causing the IndexError.

Could you please provide guidance on how to address this issue? Should I manually update the test_ids or is there another solution you would recommend?

Thank you for your help!

Best regards, Takuro