PyTorch-YOLOv3 icon indicating copy to clipboard operation
PyTorch-YOLOv3 copied to clipboard

Error about custom data training

Open ansebby opened this issue 4 years ago • 7 comments

I met error as below when I try to train the custom data(512*512 jpg images). What is the problem? Please review my error message.

python3 train.py --model_def config/yolov3-custom.cfg --data_config config/custom.data --img_size 64

Namespace(batch_size=8, checkpoint_interval=1, compute_map=False, data_config='config/custom.data', epochs=100, evaluation_interval=1, gradient_accumulations=2, img_size=64, model_def='config /yolov3-custom.cfg', multiscale_training=True, n_cpu=8, pretrained_weights=None) Traceback (most recent call last): File "train.py", line 100, in for batch_i, (_, imgs, targets) in enumerate(dataloader): File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 819, in next return self._process_data(data) File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data data.reraise() File "/opt/anaconda3/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/ansebby/PyTorch-YOLOv3/utils/datasets.py", line 130, in getitem img, targets = horisontal_flip(img, targets) File "/home/ansebby/PyTorch-YOLOv3/utils/augmentations.py", line 8, in horisontal_flip targets[:, 2] = 1 - targets[:, 2] TypeError: 'NoneType' object is not subscriptable

ansebby avatar Jan 06 '20 12:01 ansebby

Have you solve this problem,I meet the same as you

jchhuang avatar Jan 23 '20 15:01 jchhuang

Not yet. How about you?

2020년 1월 24일 (금) 오전 12:04, jchhuang [email protected]님이 작성:

Have you solve this problem,I meet the same as you

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eriklindernoren/PyTorch-YOLOv3/issues/402?email_source=notifications&email_token=AGIA4TIBQD7HV2QZO7DERVLQ7GWZFA5CNFSM4KDD2UHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJXVD5I#issuecomment-577720821, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIA4TOTCAHBNLZEZOBHD5TQ7GWZFANCNFSM4KDD2UHA .

ansebby avatar Jan 29 '20 08:01 ansebby

check the names of your images to see whether it end with '.jpg' or '.png', lowercase and uppercase make difference.

jzr0065 avatar Feb 05 '20 02:02 jzr0065

check the names of your images to see whether it end with '.jpg' or '.png', lowercase and uppercase make difference.

my dataset ends with 'png' and still appear the error, how should I modify?Thanks

guancheng817 avatar Feb 21 '20 17:02 guancheng817

Modify this line:

path.lower().replace("images", "labels").replace(
                ".png", ".txt").replace(".jpg", ".txt").replace(".jpeg", ".txt").replace(".jpeg", ".txt")

tienthegainz avatar Feb 25 '20 10:02 tienthegainz

mark

summeryumyee avatar Jul 15 '20 13:07 summeryumyee

Is this issue still relevant/occurring?

Flova avatar Sep 14 '21 09:09 Flova