ShoufaChen / DiffusionDet

[ICCV2023 Best Paper Finalist] PyTorch implementation of DiffusionDet (https://arxiv.org/abs/2211.09788)
Other
2.08k stars 163 forks source link

Training Issue: TypeError: '>' not supported between instances of 'NoneType' and 'int' #98

Closed jkini closed 1 year ago

jkini commented 1 year ago

I encounter the following message when training the SwinBase model, using the COCO dataset.

Command:
python train_net.py --num-gpus 1 --config-file configs/diffdet.coco.swinbase.yaml

Error:

Traceback (most recent call last):
  File "/home/jkini/Projects/DiffusionDet/train_net.py", line 290, in <module>
    launch(
  File "/home/jkini/Projects/DiffusionDet/detectron2/detectron2/engine/launch.py", line 84, in launch
    main_func(*args)
  File "/home/jkini/Projects/DiffusionDet/train_net.py", line 282, in main
    trainer = Trainer(cfg)
  File "/home/jkini/Projects/DiffusionDet/train_net.py", line 57, in __init__
    data_loader = self.build_train_loader(cfg)
  File "/home/jkini/Projects/DiffusionDet/train_net.py", line 118, in build_train_loader
    return build_detection_train_loader(cfg, mapper=mapper)
  File "/home/jkini/Projects/DiffusionDet/detectron2/detectron2/config/config.py", line 208, in wrapped
    return orig_func(**explicit_args)
  File "/home/jkini/Projects/DiffusionDet/detectron2/detectron2/data/build.py", line 549, in build_detection_train_loader
    return build_batch_data_loader(
  File "/home/jkini/Projects/DiffusionDet/detectron2/detectron2/data/build.py", line 339, in build_batch_data_loader
    data_loader = torchdata.DataLoader(
  File "/home/jkini/anaconda3/envs/dd/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 243, in __init__
    assert prefetch_factor > 0
TypeError: '>' not supported between instances of 'NoneType' and 'int'

Any recommendations or fixes?

jkini commented 1 year ago

Refer to the below link for the fix:

https://github.com/facebookresearch/detectron2/issues/5086