bubbliiiing / yolov8-pytorch

这是一个yolov8-pytorch的仓库,可以用于训练自己的数据集。
GNU General Public License v3.0
668 stars 78 forks source link

yolo系列全部有问题,训练解码结果不对 #6

Open williamlzw opened 1 year ago

williamlzw commented 1 year ago

yolo系列全部有问题,不加载预训练模型,解码结果偏差很大

bubbliiiing commented 1 year ago

……你训练了吗?数据集很大吗?

williamlzw commented 1 year ago

训练集40张,测试集10张,2分类。loss降到3.多,结果全错。yolo3,yolo4也训练不出来。我用别的项目模型训练矩形框偏差不大

williamlzw commented 1 year ago

有qq群,微信群吗

bubbliiiing commented 1 year ago

……你看注释了?

williamlzw commented 1 year ago

Freeze_Train = False,不进行冻结训练,我移植模型和解码到torchsharp,训练效果也不好。

bubbliiiing commented 1 year ago

……说了啊,没有预训练权重需要注意什么

Milkyway-xX commented 1 year ago

你确定就这几十张图能训练?

bubbliiiing commented 1 year ago

有预训练可以勉强用用

dstawj commented 1 year ago

D:\anaconda3\envs\py1\python.exe F:\core_code\yolov8-pytorch-master\get_map.py Load model. initialize network with normal type Traceback (most recent call last): File "F:\core_code\yolov8-pytorch-master\get_map.py", line 92, in yolo = YOLO(confidence = confidence, nms_iou = nms_iou) File "F:\core_code\yolov8-pytorch-master\yolo.py", line 91, in init self.generate() File "F:\core_code\yolov8-pytorch-master\yolo.py", line 105, in generate self.net.load_state_dict(torch.load(self.model_path, map_location=device)) File "D:\anaconda3\envs\py1\lib\site-packages\torch\nn\modules\module.py", line 1052, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for YoloBody: size mismatch for cv3.0.2.weight: copying a param with shape torch.Size([80, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 128, 1, 1]). size mismatch for cv3.0.2.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([1]). size mismatch for cv3.1.2.weight: copying a param with shape torch.Size([80, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 128, 1, 1]). size mismatch for cv3.1.2.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([1]). size mismatch for cv3.2.2.weight: copying a param with shape torch.Size([80, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 128, 1, 1]). size mismatch for cv3.2.2.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([1]).

进程已结束,退出代码为 1