Tianxiaomo / pytorch-YOLOv4

PyTorch ,ONNX and TensorRT implementation of YOLOv4
Apache License 2.0
4.46k stars 1.49k forks source link

TypeError: Caught TypeError in DataLoader worker process 0. #571

Open EslamHaourn opened 8 months ago

EslamHaourn commented 8 months ago

log file path:log/log_2023-11-01_18-25-54.txt 2023-11-01 18:25:54,478 train.py[line:619] INFO: Using device cuda 2023-11-01 18:25:57,571 train.py[line:318] INFO: Starting training: Epochs: 100 Batch size: 16 Subdivisions: 16 Learning rate: 0.001 Training size: 4488 Validation size: 1476 Checkpoints: True Device: cuda Images size: 512 Optimizer: adam Dataset classes: 6 Train label path:train.txt Pretrained:

Epoch 1/100: 0%| | 0/4488 [00:00<?, ?img/s] Traceback (most recent call last): File "train.py", line 631, in train(model=model, File "train.py", line 375, in train for i, batch in enumerate(train_loader): File "/home/eslam/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in next data = self._next_data() File "/home/eslam/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data return self._process_data(data) File "/home/eslam/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data data.reraise() File "/home/eslam/.local/lib/python3.8/site-packages/torch/_utils.py", line 429, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/eslam/.local/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop data = fetcher.fetch(index) File "/home/eslam/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/eslam/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/eslam/pytorch-YOLOv4-master/dataset.py", line 274, in getitem img_path = os.path.join(self.cfg.dataset_dir, img_path) File "/usr/lib/python3.8/posixpath.py", line 76, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

EslamHaourn commented 8 months ago

Hello, This error prevent training to start. Could you help me know the mistake I do? kindly, help me. Any help would be appreciated. Thanks in advance.