WongKinYiu / yolov9

Implementation of paper - YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information
GNU General Public License v3.0
9.04k stars 1.44k forks source link

Error when trying to validate converted model #206

Open petri-98 opened 8 months ago

petri-98 commented 8 months ago

I get this error when I try to use val.py on my converted model. Do you know why?

Traceback (most recent call last): File "/home/giuseppe-tringali/workspace/oai-yolov9/yolov9/val.py", line 389, in main(opt) File "/home/giuseppe-tringali/workspace/oai-yolov9/yolov9/val.py", line 362, in main run(*vars(opt)) File "/home/giuseppe-tringali/workspace/oai-yolov9/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(args, **kwargs) File "/home/giuseppe-tringali/workspace/oai-yolov9/yolov9/val.py", line 122, in run model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data, fp16=half) File "/home/giuseppe-tringali/workspace/oai-yolov9/yolov9/models/common.py", line 684, in init model = attempt_load(weights if isinstance(weights, list) else w, device=device, inplace=True, fuse=fuse) File "/home/giuseppe-tringali/workspace/oai-yolov9/yolov9/models/experimental.py", line 243, in attempt_load ckpt = torch.load(attempt_download(w), map_location='cpu') # load File "/home/giuseppe-tringali/workspace/oai-yolov9/venv/lib/python3.10/site-packages/torch/serialization.py", line 1026, in load return _load(opened_zipfile, File "/home/giuseppe-tringali/workspace/oai-yolov9/venv/lib/python3.10/site-packages/torch/serialization.py", line 1438, in _load result = unpickler.load() File "/home/giuseppe-tringali/workspace/oai-yolov9/venv/lib/python3.10/site-packages/torch/serialization.py", line 1431, in find_class return super().find_class(mod_name, name) ModuleNotFoundError: No module named 'yolo'

Youho99 commented 8 months ago

I'm not sure, but i believe converted models are only for inference

Use val_dual.py on your yolov9 model