Skip to content

train_dataloader长度为0,也就是根本没读到数据 #10

@taishan0001

Description

@taishan0001

Traceback (most recent call last):
File "main.py", line 239, in
mp.spawn(main,
File "/home/hecheng/.conda/envs/WSI/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/home/hecheng/.conda/envs/WSI/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 198, in start_processes
while not context.join():
File "/home/hecheng/.conda/envs/WSI/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 160, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:

-- Process 2 terminated with the following error:
Traceback (most recent call last):
File "/home/hecheng/.conda/envs/WSI/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/home/hecheng/code/WSI-VQA/main.py", line 222, in main
trainer.train(local_rank)
File "/home/hecheng/code/WSI-VQA/modules/trainer.py", line 65, in train
result = self._train_epoch(rank)
File "/home/hecheng/code/WSI-VQA/modules/trainer.py", line 298, in _train_epoch
log = {'train_loss': train_loss / len(self.train_dataloader)}
ZeroDivisionError: division by zero

为什么我的train_dataloader的长度会是0,也就是根本没读到数据

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions