Skip to content

tiny使用自己微调的模型推理的时候报错 #23

@dgx11678832

Description

@dgx11678832

我使用的是Closed-set finetuning微调方法,在test中能正常输出
Traceback (most recent call last):
File "/home/gxdong/yolo/WeDetect-main/infer_wedetect.py", line 213, in
model.reparameterize(texts)
File "/home/gxdong/anaconda3/envs/openmmlab_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
AttributeError: 'SimpleYOLOWorldDetector' object has no attribute 'reparameterize'. Did you mean: 'reparameterized'?

我是用的是tiny
python3 infer_wedetect.py
--config /home/gxdong/yolo/WeDetect-main/work_dirs/wedetect_tiny_all/20260407_065304/vis_data/config.py
--checkpoint /home/gxdong/yolo/WeDetect-main/work_dirs/wedetect_tiny_all/best_coco_bbox_mAP_epoch_20.pth
--image images/aaa.jpg
--text '大车,小车,非机动车,人'
--threshold 0.1

更换成命令 不报错 但是加载
python3 infer_wedetect.py
--config /home/gxdong/yolo/WeDetect-main/config/wedetect_tiny.py
--checkpoint /home/gxdong/yolo/WeDetect-main/work_dirs/wedetect_tiny_all/best_coco_bbox_mAP_epoch_20.pth
--image images/aaa.jpg
--text '大车,小车,非机动车,人'
--threshold 0.1
The model and loaded state dict do not match exactly
missing keys in source state_dict: backbone.text_model.model.embeddings.word_embeddings.weight, backbone.text_model.model.embeddings.position_embeddings.weight, backbone.text_model.model.embeddings.token_type_embeddings.weight,****
我看了下都是 backbone.text_model. 开头的 然后输出的图片 有检测框 但是很多很乱 并且类别不对

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions