Tianxiaomo / pytorch-YOLOv4

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

Training error #458

Open Ronald-Kray opened 3 years ago

Ronald-Kray commented 3 years ago

Please help me With this @Tianxiaomo

('Yolov44') C:\Users---\PycharmProjects\Yolov44>python train.py -g 2 log file path:log\log_2021-08-04_18-22-34.txt 2021-08-04 18:22:35,064 train.py[line:435] INFO: Using device cuda 2021-08-04 18:22:37,255 train.py[line:282] INFO: Starting training: Epochs: 10 Batch size: 30 Subdivisions: 1 Learning rate: 0.001 Training size: 1526 Validation size: 377 Checkpoints: True Device: cuda Images size: 512 Optimizer: adam Dataset classes: 1 Train label path:dataset/train/train.txt Pretrained:

Epoch 1/10: 0%| | 0/1526 [00:11<?, ?img/s] Traceback (most recent call last): File "train.py", line 447, in device=device, ) File "train.py", line 310, in train for i, batch in enumerate(train_loader): File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next data = self._next_data() File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data return self._process_data(data) File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data data.reraise() File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch_utils.py", line 394, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch\utils\data_utils\worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\ha485.conda\envs\'Yolov44'\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\ha485\PycharmProjects\Yolov44\dataset.py", line 269, in getitem img_path = os.path.join(self.cfg.dataset_dir, img_path) File "C:\Users\ha485.conda\envs\'Yolov44'\lib\ntpath.py", line 76, in join path = os.fspath(path) TypeError: expected str, bytes or os.PathLike object, not NoneType

rak7045 commented 3 years ago

Hello @Ronald-Kray Could you able to solve this problem?

I also got the same error almost.

colaberror

Could you please help me with this?

Previously I also got error in dataset.py line [261]. Since I have string in my train.txt I have the line in the following way: truth[data[0]].append([int(float(j)) for j in i.split(',')])

Could you also clarify me how you prepared your dataset and where did you place the file?