Dataloader length is 0
Hello, i am trying to train this model on a custom dataset but getting this error,
[rank0]: Traceback (most recent call last):
[rank0]: File "/kaggle/working/DEIM/train.py", line 84, in <module>
[rank0]: main(args)
[rank0]: File "/kaggle/working/DEIM/train.py", line 54, in main
[rank0]: solver.fit()
[rank0]: File "/kaggle/working/DEIM/engine/solver/det_solver.py", line 77, in fit
[rank0]: train_stats = train_one_epoch(
[rank0]: ^^^^^^^^^^^^^^^^
[rank0]: File "/kaggle/working/DEIM/engine/solver/det_engine.py", line 42, in train_one_epoch
[rank0]: for i, (samples, targets) in enumerate(metric_logger.log_every(data_loader, print_freq, header)):
[rank0]: File "/kaggle/working/DEIM/engine/misc/logger.py", line 238, in log_every
[rank0]: header, total_time_str, total_time / len(iterable)))
[rank0]: ~~~~~~~~~~~^~~~~~~~~~~~~~~
[rank0]: ZeroDivisionError: float division by zero
[rank1]: Traceback (most recent call last):
[rank1]: File "/kaggle/working/DEIM/train.py", line 84, in <module>
[rank1]: main(args)
[rank1]: File "/kaggle/working/DEIM/train.py", line 54, in main
[rank1]: solver.fit()
[rank1]: File "/kaggle/working/DEIM/engine/solver/det_solver.py", line 77, in fit
[rank1]: train_stats = train_one_epoch(
[rank1]: ^^^^^^^^^^^^^^^^
[rank1]: File "/kaggle/working/DEIM/engine/solver/det_engine.py", line 42, in train_one_epoch
[rank1]: for i, (samples, targets) in enumerate(metric_logger.log_every(data_loader, print_freq, header)):
[rank1]: File "/kaggle/working/DEIM/engine/misc/logger.py", line 238, in log_every
[rank1]: header, total_time_str, total_time / len(iterable)))
[rank1]: ~~~~~~~~~~~^~~~~~~~~~~~~~~
[rank1]: ZeroDivisionError: float division by zero
Further debugging, I could not find any code that tells me where the dataloader is loading the dataset from, and the path that the dataset is using to load images, and which dataset class is being used. Would you guide me through it?
another issue is that:
141.4s 47 [92mIf the pretrained HGNetV2 can't be downloaded automatically. Please check your network connection.[0m
141.4s 48 [92mPlease check your network connection. Or download the model manually from [0mhttps://github.com/Peterande/storage/releases/download/dfinev1.0/PPHGNetV2_B0_stage1.pth[92m to [0m../RT-DETR-main/D-FINE/weight/hgnetv2/.[0m
141.4s 49 Downloading: "https://github.com/Peterande/storage/releases/download/dfinev1.0/PPHGNetV2_B0_stage1.pth" to ../RT-DETR-main/D-FINE/weight/hgnetv2/PPHGNetV2_B0_stage1.pth
141.8s 50
0%| | 0.00/7.21M [00:00<?, ?B/s]
100%|██████████████████████████████████████| 7.21M/7.21M [00:00<00:00, 95.7MB/s]
141.8s 51 Loaded stage1 B0 HGNetV2 from URL.
141.8s 52 /kaggle/working/DEIM/engine/backbone/hgnetv2.py:505: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
141.8s 53 state = torch.load(local_model_dir)
Everytime a new model is downloaded, instead of loading it gets stuck here indefinitely. Why is that? I have to cancel the process and rerun the script, i assume it has something to do with downloading the model and then loading it (it works normally if the pretrained weight is already downloaded)
ZeroDivisionError: float division by zero 你的 num_classes : 1 ,若是这样,你改成2, 就不报错了,但未知什么原因,请作者处理下