PyTorch-YOLOv3
PyTorch-YOLOv3 copied to clipboard
train on voc dataset
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?
I also has this problem, had you solve it?
@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.
I also has this problem, had you solve it?
应该就是路径不对,我把VOC的几张某一类别(dog)的图片放到custom中,设置一下相应文件class.names、yolo-custom.cfg以及相应train、test.txt等是可以使用的。
你训练的是原始的VOC数据集吗?效果怎么样?我训练出来检测结果特别差,难道哪里做错了。。。
@JeasonUESTC 是的,我的效果也不好.你的效果怎么样呀(可以加我讨论一下Q1017176539)
我在原始的VOC2007数据集上训练效果也很差,请问你们解决了吗?
你训练的是原始的VOC数据集吗?效果怎么样?我训练出来检测结果特别差,难道哪里做错了。。。
我的效果也很差 map=0.11 请问你有什么解决方法了吗
我训练的是VOC2007,充分训练mAP也只有0.2多,具体多少记不清了。。。
我训练的是VOC2007,充分训练mAP也只有0.2多,具体多少记不清了。。。
路径问题,datasets.py的self.label_files中images改成JPEGImages就好了,作者在根据图像路径找txt路径,但是按照coco写的,在用voc时候需要改一下
@ZhxJia @JeasonUESTC 请问你们在voc上训练map值低的问题解决了吗? :(
@ArtyZe 这个版本的模型训练不收敛 建议换一个版本的yolo
@ArtyZe 这个版本的模型训练不收敛 建议换一个版本的yolo
请问是为啥呀?训练其他的数据集是ok的,只有voc不行。请问您那边训练其他的数据集也不行吗