WongKinYiu / yolor

implementation of paper - You Only Learn One Representation: Unified Network for Multiple Tasks (https://arxiv.org/abs/2105.04206)
GNU General Public License v3.0
1.99k stars 518 forks source link

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

Open Taitai6521 opened 2 years ago

Taitai6521 commented 2 years ago

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!

DongChen06 commented 2 years ago

Same issue, any solutions?

DoubleRedX commented 2 years ago

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

TANKCHENG commented 2 years ago

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

x-yy0 commented 2 years ago

Is there a solution?

TANKCHENG commented 2 years ago

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

x-yy0 commented 2 years ago

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?

RizwanMunawar commented 2 years ago

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

akfmdl commented 1 year ago

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

TANKCHENG commented 1 year ago

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