yolor icon indicating copy to clipboard operation
yolor copied to clipboard

ModuleNotFoundError: No module named 'models.yolo' #6326

Open Taitai6521 opened this issue 3 years ago • 9 comments

Search before asking I have searched the YOLOv5 issues and found no similar bug report. YOLOv5 Component No response

Bug

Namespace(agnostic_nms=False, augment=False, cfg='/content/drive/MyDrive/神様/Augmentedstartups/yolor/cfg/yolor_w6.cfg', classes=None, conf_thres=0.25, device='0', img_size=1280, iou_thres=0.5, names='data/coco.names', output='/content/drive/MyDrive/Dev/Soccer/Output', save_txt=False, source='/content/drive/MyDrive/神様/Augmentedstartups/yolor/inference/images/horses.jpg', update=False, view_img=False, weights=['/content/drive/MyDrive/神様/Augmentedstartups/yolor/yolor-w6.pt'])
Traceback (most recent call last):
File "detect.py", line 186, in
detect()
File "detect.py", line 44, in detect
model.load_state_dict(torch.load(weights[0], map_location=device)['model'])
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 607, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 882, in _load
result = unpickler.load()
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 875, in find_class
return super().find_class(mod_name, name)
ModuleNotFoundError: No module named 'models.yolo'

Environment YoloR OS googlecolab

Minimal Reproducible Example https://github.com/Taitai6521/ModuleNotFoundError-No-module-named-models.yolo- If you refer to the code here, you will be able to understand the contents. Thank you very much for your cooperation.

Additional No response

Are you willing to submit a PR? Yes I'd like to help by submitting a PR!

Taitai6521 avatar Jan 18 '22 00:01 Taitai6521

Same issue, any solutions?

DongChen06 avatar Jan 22 '22 04:01 DongChen06

Maybe u guys used the main branch ? U could try the paper branch.

DoubleRedX avatar Feb 05 '22 11:02 DoubleRedX

checkpoint paper branch. This is really a confusing point if you don't read it carefully

TANKCHENG avatar Feb 10 '22 01:02 TANKCHENG

Is there a solution?

x-yy0 avatar Apr 20 '22 01:04 x-yy0

自动回复:             已收到,谢谢来信

TANKCHENG avatar Apr 20 '22 01:04 TANKCHENG

Search before asking I have searched the YOLOv5 issues and found no similar bug report. YOLOv5 Component No response

Bug

Namespace(agnostic_nms=False, augment=False, cfg='/content/drive/MyDrive/神様/Augmentedstartups/yolor/cfg/yolor_w6.cfg', classes=None, conf_thres=0.25, device='0', img_size=1280, iou_thres=0.5, names='data/coco.names', output='/content/drive/MyDrive/Dev/Soccer/Output', save_txt=False, source='/content/drive/MyDrive/神様/Augmentedstartups/yolor/inference/images/horses.jpg', update=False, view_img=False, weights=['/content/drive/MyDrive/神様/Augmentedstartups/yolor/yolor-w6.pt'])
Traceback (most recent call la

I have the same problem, have you solved it?

x-yy0 avatar Apr 20 '22 02:04 x-yy0

Is there a solution?

It seems that you are using code of main branch and weights of paper branch. If you want to use paper branch, then make sure to use paper branch weights and vice versa.

Yolor-p6 main branch weights: yolor-p6.pt Yolor-p6 paper branch weights: yolor_p6.pt

RizwanMunawar avatar May 08 '22 06:05 RizwanMunawar

i found the reason. there was a 'models.py' file at the same depth

akfmdl avatar Jan 17 '23 06:01 akfmdl

自动回复:             已收到,谢谢来信

TANKCHENG avatar Jan 17 '23 06:01 TANKCHENG