ai-forever / ai-forever/CerberusDet

How to run inference?

未关闭
#4 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
40
派生
6
PR 合并指标
30 天内没有已合并 PR

描述

I installed ultralytics with the commit that is in the README but when running the detect.py script i get the following error:

```
python cerberusdet/detect.py --weights OBJ365_full_best_state_dict.pt --source test.png
/home/charlie/data/kiwi/CerberusDet/cerberusdet/utils/checks.py:10: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources as pkg
detect: weights=OBJ365_full_best_state_dict.pt, source=test.png, imgsz=640, conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_crop=False, nosave=False, agnostic_nms=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=0, hide_labels=False, hide_conf=False, hide_task=False, half=False
requirements: /home/charlie/data/kiwi/CerberusDet/requirements.txt not found, check failed.
🚀 5e173dc torch 2.9.0+cu128 CUDA:0 (NVIDIA GeForce RTX 3070 Laptop GPU, 7866.75MB)

2025-10-17 15:22:41.542 | INFO | cerberusdet.models.experimental:attempt_load:121 - Loading ../sauron/.models/OBJ365_full_best_state_dict.pt...
Traceback (most recent call last):
File "/home/charlie/data/kiwi/CerberusDet/cerberusdet/detect.py", line 273, in
main(opt)
File "/home/charlie/data/kiwi/CerberusDet/cerberusdet/detect.py", line 268, in main
run(**vars(opt))
File "/home/charlie/miniconda3/envs/yolov8-cerberusdet/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
File "/home/charlie/data/kiwi/CerberusDet/cerberusdet/detect.py", line 152, in run
model: CerberusDet = attempt_load(weights, map_location=device, mlflow_url=mlflow_url) # load FP32 model
File "/home/charlie/data/kiwi/CerberusDet/cerberusdet/models/experimental.py", line 122, in attempt_load
model: CerberusDet = ckpt["ema" if ckpt.get("ema") else "model"].float().fuse().eval() # FP32 model
KeyError: 'model'
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。