Megvii-BaseDetection / YOLOX

YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with MegEngine, ONNX, TensorRT, ncnn, and OpenVINO supported. Documentation: https://yolox.readthedocs.io/
Apache License 2.0
9.43k stars 2.21k forks source link

When loading two Dataloader at the same time, the second dataloader gets stuck when executing the next function #524

Open wintercat1994 opened 3 years ago

wintercat1994 commented 3 years ago

I want each batch to always consist of images from two different datasets. I tried to define two prefetchers or define two dataloader, but either way I stopped there when executing the following statement.

inps2,targets2,,=next(self.prefetcher2)

How can I combine images from two datasets in one batch?

GOATmessi8 commented 3 years ago

See https://github.com/Megvii-BaseDetection/YOLOX/blob/main/yolox/data/datasets/datasets_wrapper.py#L12

wintercat1994 commented 3 years ago

Why can't I load two Dataloader and splice them?Is it blocking for the two Dataloader have something in common?

wintercat1994 commented 3 years ago

Thanks for your reply!