Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EslamHaourn opened this issue Nov 1, 2023 · 1 comment
Open

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

EslamHaourn opened this issue Nov 1, 2023 · 1 comment

Comments

@EslamHaourn
Copy link

EslamHaourn commented Nov 1, 2023

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant