RL4M / MRM-pytorch

An official implementation of Advancing Radiograph Representation Learning with Masked Record Modeling (ICLR'23)
MIT License
72 stars 4 forks source link

StopIteration Error #5

Open realmadridchenwentao opened 1 year ago

realmadridchenwentao commented 1 year ago

Thanks for your reply about the dataset in the former issue! After I fine-tune the SIIM-ACR Pneumothorax segmentation task with pre-trained model weights and run ft.sh with mmsegmentation, the following error is reported:

Traceback (most recent call last):
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 34, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/train.py", line 242, in <module>
    main()
  File "tools/train.py", line 231, in main
    train_segmentor(
  File "/home/wentaochen/mmsegmentation/mmseg/apis/train.py", line 194, in train_segmentor
    runner.run(data_loaders, cfg.workflow)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 144, in run
    iter_runner(iter_loaders[i], **kwargs)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 61, in train
    data_batch = next(data_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 41, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration
Traceback (most recent call last):
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 34, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/train.py", line 242, in <module>
    main()
  File "tools/train.py", line 231, in main
    train_segmentor(
  File "/home/wentaochen/mmsegmentation/mmseg/apis/train.py", line 194, in train_segmentor
    runner.run(data_loaders, cfg.workflow)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 144, in run
    iter_runner(iter_loaders[i], **kwargs)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 61, in train
    data_batch = next(data_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 41, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration
Traceback (most recent call last):
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 34, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/train.py", line 242, in <module>
    main()
  File "tools/train.py", line 231, in main
    train_segmentor(
  File "/home/wentaochen/mmsegmentation/mmseg/apis/train.py", line 194, in train_segmentor
    runner.run(data_loaders, cfg.workflow)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 144, in run
    iter_runner(iter_loaders[i], **kwargs)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 61, in train
    data_batch = next(data_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 41, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration
Traceback (most recent call last):
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 34, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tools/train.py", line 242, in <module>
    main()
  File "tools/train.py", line 231, in main
    train_segmentor(
  File "/home/wentaochen/mmsegmentation/mmseg/apis/train.py", line 194, in train_segmentor
    runner.run(data_loaders, cfg.workflow)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 144, in run
    iter_runner(iter_loaders[i], **kwargs)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 61, in train
    data_batch = next(data_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 41, in __next__
    data = next(self.iter_loader)
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/wentaochen/anaconda3/envs/MRM/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1172, in _next_data
    raise StopIteration
StopIteration

Hope you can give me some advice! Thank you very much!

SZUHvern commented 1 year ago

I have the same problem, have you solved it?

GUESSZERO4 commented 3 months ago

I had the same problem when I recently reproduced this work? Have you solved it yet?