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

train on voc dataset

Open yyx1107 opened this issue 5 years ago • 13 comments

I want to train on VOC ,and I modified voc.data,voc.names and yolo.cfg.And I use voc_label.py to get 2007_train.text and 2007_test.text.

When I run "python3 train.py --data_config config/voc.data --pretrained_weights weights/darknet53.conv.74",there are some errors:

Traceback (most recent call last): File "train.py", line 99, in for batch_i, (_, imgs, targets) in enumerate(dataloader): File "/home/yyx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in next return self._process_next_batch(batch) File "/home/yyx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) TypeError: Traceback (most recent call last): File "/home/yyx/.local/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/yyx/.local/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/yyx/PyTorch-YOLOv3-master/utils/datasets.py", line 130, in getitem img, targets = horisontal_flip(img, targets) File "/home/yyx/PyTorch-YOLOv3-master/utils/augmentations.py", line 8, in horisontal_flip targets[:, 2] = 1 - targets[:, 2] TypeError: 'NoneType' object is not subscriptable

Is there anything else that needs to be changed?

yyx1107 avatar Jun 11 '19 11:06 yyx1107

I also has this problem, had you solve it?

YingYingQinn avatar Jun 18 '19 13:06 YingYingQinn

@YingYingQinn I haven't solved it yet. There are some opinions that others told me.Can you tell me if you solve this problem? 1)Check your images, some of the images may be broken, you can print the image path when come with this problem. Use try..... except...... @yyx1107 2)@yyx1107 It's my file path problem, I modified the txt file location.

yyx1107 avatar Jun 19 '19 07:06 yyx1107

I also has this problem, had you solve it?

应该就是路径不对,我把VOC的几张某一类别(dog)的图片放到custom中,设置一下相应文件class.names、yolo-custom.cfg以及相应train、test.txt等是可以使用的。

yyx1107 avatar Jun 27 '19 06:06 yyx1107

你训练的是原始的VOC数据集吗?效果怎么样?我训练出来检测结果特别差,难道哪里做错了。。。

JeasonUESTC avatar Jul 05 '19 09:07 JeasonUESTC

@JeasonUESTC 是的,我的效果也不好.你的效果怎么样呀(可以加我讨论一下Q1017176539)

yyx1107 avatar Jul 05 '19 09:07 yyx1107

我在原始的VOC2007数据集上训练效果也很差,请问你们解决了吗?

H-YunHui avatar Jul 27 '19 09:07 H-YunHui

你训练的是原始的VOC数据集吗?效果怎么样?我训练出来检测结果特别差,难道哪里做错了。。。

我的效果也很差 map=0.11 请问你有什么解决方法了吗

ZhxJia avatar Aug 02 '19 01:08 ZhxJia

我训练的是VOC2007,充分训练mAP也只有0.2多,具体多少记不清了。。。

JeasonUESTC avatar Aug 02 '19 06:08 JeasonUESTC

我训练的是VOC2007,充分训练mAP也只有0.2多,具体多少记不清了。。。

JeasonUESTC avatar Aug 02 '19 06:08 JeasonUESTC

路径问题,datasets.py的self.label_files中images改成JPEGImages就好了,作者在根据图像路径找txt路径,但是按照coco写的,在用voc时候需要改一下

leisureandfree avatar Oct 21 '19 06:10 leisureandfree

@ZhxJia @JeasonUESTC 请问你们在voc上训练map值低的问题解决了吗? :(

ArtyZe avatar Jul 06 '20 07:07 ArtyZe

@ArtyZe 这个版本的模型训练不收敛 建议换一个版本的yolo

summeryumyee avatar Jul 15 '20 13:07 summeryumyee

@ArtyZe 这个版本的模型训练不收敛 建议换一个版本的yolo

请问是为啥呀?训练其他的数据集是ok的,只有voc不行。请问您那边训练其他的数据集也不行吗

ArtyZe avatar Jul 16 '20 08:07 ArtyZe