How I am creating the dataloader:
dataloader = torch.utils.data.DataLoader( dataset=dataset, batch_size=self.batch_size, num_workers=self.num_workers, worker_init_fn=worker_init_fn, sampler=sampler, shuffle=is_train if sampler is None else False, )tr_gen = SingleThreadedAugmenter(dataloader, tr_transforms)
I get the error:
Epoch 0: : 0it [00:00, ?it/s]Traceback (most recent call last): File "/home/train_varnet_demo.py", line 215, in <module> run_cli() File "/home/train_varnet_demo.py", line 211, in run_cli cli_main(args) File "/home/train_varnet_demo.py", line 81, in cli_main trainer.fit(model, datamodule=data_module) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 608, in fit call._call_and_handle_interrupt( File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 38, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 650, in _fit_impl self._run(model, ckpt_path=self.ckpt_path) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1103, in _run results = self._run_stage() File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1182, in _run_stage self._run_train() File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1205, in _run_train self.fit_loop.run() File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/loop.py", line 199, in run self.advance(*args, **kwargs) File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/fit_loop.py", line 267, in advance self._outputs = self.epoch_loop.run(self._data_fetcher) File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/loop.py", line 194, in run self.on_run_start(*args, **kwargs) File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 160, in on_run_start _ = iter(data_fetcher) # creates the iterator inside the fetcher File "/home/lib/python3.9/site-packages/pytorch_lightning/utilities/fetching.py", line 180, in __iter__ self.prefetching() File "/home/lib/python3.9/site-packages/pytorch_lightning/utilities/fetching.py", line 243, in prefetching self._fetch_next_batch(iterator) File "/home/lib/python3.9/site-packages/pytorch_lightning/utilities/fetching.py", line 280, in _fetch_next_batch batch = next(iterator) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/supporters.py", line 569, in __next__ return self.request_next_batch(self.loader_iters) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/supporters.py", line 581, in request_next_batch return apply_to_collection(loader_iters, Iterator, next) File "/home/python3.9/site-packages/lightning_utilities/core/apply_func.py", line 64, in apply_to_collection return function(data, *args, **kwargs) File "/home/lib/python3.9/site-packages/batchgenerators/dataloading/single_threaded_augmenter.py", line 36, in __next__ item = next(self.data_loader) TypeError: 'DataLoader' object is not an iterator Epoch 0: : 0it [00:35, ?it/s]
How I am creating the dataloader:
dataloader = torch.utils.data.DataLoader( dataset=dataset, batch_size=self.batch_size, num_workers=self.num_workers, worker_init_fn=worker_init_fn, sampler=sampler, shuffle=is_train if sampler is None else False, )
tr_gen = SingleThreadedAugmenter(dataloader, tr_transforms)
I get the error:
Epoch 0: : 0it [00:00, ?it/s]Traceback (most recent call last): File "/home/train_varnet_demo.py", line 215, in <module> run_cli() File "/home/train_varnet_demo.py", line 211, in run_cli cli_main(args) File "/home/train_varnet_demo.py", line 81, in cli_main trainer.fit(model, datamodule=data_module) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 608, in fit call._call_and_handle_interrupt( File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 38, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 650, in _fit_impl self._run(model, ckpt_path=self.ckpt_path) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1103, in _run results = self._run_stage() File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1182, in _run_stage self._run_train() File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1205, in _run_train self.fit_loop.run() File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/loop.py", line 199, in run self.advance(*args, **kwargs) File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/fit_loop.py", line 267, in advance self._outputs = self.epoch_loop.run(self._data_fetcher) File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/loop.py", line 194, in run self.on_run_start(*args, **kwargs) File "/home/lib/python3.9/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 160, in on_run_start _ = iter(data_fetcher) # creates the iterator inside the fetcher File "/home/lib/python3.9/site-packages/pytorch_lightning/utilities/fetching.py", line 180, in __iter__ self.prefetching() File "/home/lib/python3.9/site-packages/pytorch_lightning/utilities/fetching.py", line 243, in prefetching self._fetch_next_batch(iterator) File "/home/lib/python3.9/site-packages/pytorch_lightning/utilities/fetching.py", line 280, in _fetch_next_batch batch = next(iterator) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/supporters.py", line 569, in __next__ return self.request_next_batch(self.loader_iters) File "/home/lib/python3.9/site-packages/pytorch_lightning/trainer/supporters.py", line 581, in request_next_batch return apply_to_collection(loader_iters, Iterator, next) File "/home/python3.9/site-packages/lightning_utilities/core/apply_func.py", line 64, in apply_to_collection return function(data, *args, **kwargs) File "/home/lib/python3.9/site-packages/batchgenerators/dataloading/single_threaded_augmenter.py", line 36, in __next__ item = next(self.data_loader) TypeError: 'DataLoader' object is not an iterator Epoch 0: : 0it [00:35, ?it/s]