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

训练单类别数据集时(使用rolabelImg制作300张图片)运行detect.py和val.py没有预测框。 #23

Closed
1 task done
pangguanzhe344 opened this issue Nov 23, 2021 · 4 comments
Labels
question Further information is requested

Comments

@pangguanzhe344
Copy link

Search before asking

Question

Epoch gpu_mem box obj cls angle labels img_size
99/99 2.44G 0.1441 0.001176 0 0.002967 10 640
Class Images Labels P R mAP@.5 mAP@
all 30 0 0 0 0 0

100 epochs completed in 0.805 hours.
Optimizer stripped from runs/train/exp2/weights/last.pt, 15.4MB
Optimizer stripped from runs/train/exp2/weights/best.pt, 15.4MB

Validating runs/train/exp2/weights/best.pt...
Fusing layers...
Model Summary: 213 layers, 7498282 parameters, 0 gradients, 17.4 GFLOPs
Class Images Labels P R mAP@.5 mAP@
all 30 0 0 0 0 0
Results saved to runs/train/exp2

这是训练100轮的,每次都是Labels=0 P=0 R=0 ....是不是单类别的原因,还是其他问题?训练结果中的val_batch0_labels.jpg标出了label的框。
麻烦您解答。谢谢!

Additional

val: data=data/SKU-110K.yaml, weights=runs/train/exp2/weights/best.pt, batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, task=val, device=, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False
YOLOv5 🚀 2021-11-18 torch 1.7.1+cu101 CUDA:0 (Tesla T4, 4308MiB)

Fusing layers...
Model Summary: 213 layers, 7498282 parameters, 0 gradients, 17.4 GFLOPs
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
Class Images Labels P R mAP@.5 mAP@
all 30 0 0 0 0 0
Speed: 6.5ms pre-process, 16.8ms inference, 33.7ms NMS per image at shape (32, 3, 640, 640)
val: Scanning 'data/labels/val.cache' images and labels... 30 found, 0 missing,
Results saved to runs/val/exp

@pangguanzhe344 pangguanzhe344 added the question Further information is requested label Nov 23, 2021
@acai66
Copy link
Owner

acai66 commented Nov 23, 2021

试试不要用单类别,自定义数据集.yaml 配置里nc改为2,name里加个None,像这样:

# Classes
nc: 2 
names: ['object', 'None']

@pangguanzhe344
Copy link
Author

可以了!训练有结果了。在colab上训练的。感谢您的回答!跑通您的代码后,要努力看您的代码了!
image

@acai66 acai66 closed this as completed Nov 24, 2021
@tkone2018
Copy link

@pangguanzhe344 你好,请问你训练的时候有预训练模型吗

@tkone2018
Copy link

@acai66 你好,可以分享一下demo模型吗,谢谢

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

No branches or pull requests

3 participants