Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get attribute 'DetectionModel' on <module 'models.yolo' from '/content/yolov5/yolov5_prune/models/yolo.py'> #6

Open
seungyong0313 opened this issue Sep 17, 2022 · 1 comment

Comments

@seungyong0313
Copy link

what's the error?

Traceback (most recent call last):
File "prune.py", line 223, in
main()
File "prune.py", line 209, in main
prune(**params_prune)
File "/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "prune.py", line 85, in prune
model = DetectMultiBackend(weights, device=device, dnn=dnn, fuse=False)
File "/content/yolov5/yolov5_prune/models/common.py", line 308, in init
model = attempt_load(weights if isinstance(weights, list) else w, map_location=device, fuse=fuse)
File "/content/yolov5/yolov5_prune/models/experimental.py", line 96, in attempt_load
ckpt = torch.load(attempt_download(w), map_location=map_location) # load
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 712, 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 1049, in _load
result = unpickler.load()
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 1042, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'DetectionModel' on <module 'models.yolo' from '/content/yolov5/yolov5_prune/models/yolo.py'>

@uyzhang
Copy link
Owner

uyzhang commented Sep 18, 2022

What is your command to run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants